From 98fc7a6749b213ee3ef4e617f128648b2f64ca91 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 7 Nov 2025 08:32:39 +0000 Subject: [PATCH] Fix cyclic object error in onboarding step completion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Issue:** When clicking Continue button in setup steps (quality, inventory, recipes, team, review), got error: "cyclic object value" **Root Cause:** Button onClick handlers were passing React event object directly to onComplete: ```tsx onClick={onComplete} // Passes event as first argument ``` React event objects have circular references (target, currentTarget, etc.) which cannot be JSON.stringify'd for API calls. **Solution:** Wrap all onComplete calls in arrow functions to prevent event from being passed: ```tsx onClick={() => onComplete()} // Calls with no arguments ``` **Files Fixed:** - QualitySetupStep.tsx:436 - InventorySetupStep.tsx:1014 - RecipesSetupStep.tsx:801 - ReviewSetupStep.tsx:314 - TeamSetupStep.tsx:318 **Error Log (Before Fix):** ``` Completing step: "quality-setup" with data: Object { _reactName: "onClick", _targetInst: null, type: "click", ... ❌ API error: "cyclic object value" ``` **After Fix:** ✅ onComplete() called with no arguments ✅ No event object passed to API ✅ Step completion works correctly **Build Status:** ✓ Successful in 22.11s --- .../components/domain/setup-wizard/steps/InventorySetupStep.tsx | 2 +- .../components/domain/setup-wizard/steps/QualitySetupStep.tsx | 2 +- .../components/domain/setup-wizard/steps/RecipesSetupStep.tsx | 2 +- .../components/domain/setup-wizard/steps/ReviewSetupStep.tsx | 2 +- .../src/components/domain/setup-wizard/steps/TeamSetupStep.tsx | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/domain/setup-wizard/steps/InventorySetupStep.tsx b/frontend/src/components/domain/setup-wizard/steps/InventorySetupStep.tsx index f78dd217..b864fd46 100644 --- a/frontend/src/components/domain/setup-wizard/steps/InventorySetupStep.tsx +++ b/frontend/src/components/domain/setup-wizard/steps/InventorySetupStep.tsx @@ -1011,7 +1011,7 @@ export const InventorySetupStep: React.FC = ({ onUpdate, onCompl {onComplete && (