Spire tab crashes with "getAllGuardianFloors is not defined" ReferenceError #249

Closed
opened 2026-06-01 15:04:24 +02:00 by Anexim · 2 comments
Owner

Steps to reproduce:

  1. Start a fresh game
  2. Unlock Invoker attunement (via Attunements tab or debug)
  3. Click the "🏔️ Spire" tab in the main navigation

Expected: Spire summary tab loads showing floor progress, guardian roster, etc.

Actual: Tab shows "spire tab failed to load" and console shows:

ReferenceError: getAllGuardianFloors is not defined
    at tM (SpireSummaryTab.helpers.tsx)

Root cause: The SpireSummaryTab.helpers.tsx file imports getAllGuardianFloors from @/lib/game/data/guardian-encounters and calls it at module level (line 8: const GUARDIAN_FLOORS = getAllGuardianFloors()). The function IS properly exported from guardian-encounters.ts (line 375), but at runtime it's undefined. This appears to be a build/bundling issue where the function is not properly included in the production chunk.

Affected files:

  • src/components/game/tabs/SpireSummaryTab.helpers.tsx (line 6, 8)
  • src/components/game/tabs/SpireSummaryTab.tsx (line 98-99)

Store: useCombatStore / usePrestigeStore (SpireSummaryTab reads from both)

**Steps to reproduce:** 1. Start a fresh game 2. Unlock Invoker attunement (via Attunements tab or debug) 3. Click the "🏔️ Spire" tab in the main navigation **Expected:** Spire summary tab loads showing floor progress, guardian roster, etc. **Actual:** Tab shows "spire tab failed to load" and console shows: ``` ReferenceError: getAllGuardianFloors is not defined at tM (SpireSummaryTab.helpers.tsx) ``` **Root cause:** The `SpireSummaryTab.helpers.tsx` file imports `getAllGuardianFloors` from `@/lib/game/data/guardian-encounters` and calls it at module level (line 8: `const GUARDIAN_FLOORS = getAllGuardianFloors()`). The function IS properly exported from `guardian-encounters.ts` (line 375), but at runtime it's `undefined`. This appears to be a build/bundling issue where the function is not properly included in the production chunk. **Affected files:** - `src/components/game/tabs/SpireSummaryTab.helpers.tsx` (line 6, 8) - `src/components/game/tabs/SpireSummaryTab.tsx` (line 98-99) **Store:** `useCombatStore` / `usePrestigeStore` (SpireSummaryTab reads from both)
Anexim added the ai:todo label 2026-06-01 15:04:24 +02:00
n8n-gitea was assigned by Anexim 2026-06-01 15:04:24 +02:00
Author
Owner

Starting investigation. Reading SpireSummaryTab.helpers.tsx and guardian-encounters.ts to trace the import/export issue.

Starting investigation. Reading SpireSummaryTab.helpers.tsx and guardian-encounters.ts to trace the import/export issue.
Author
Owner

Fixed: Added missing getAllGuardianFloors import to SpireSummaryTab.tsx line 7. The function was used in useMemo calls (lines 98-99) but never imported — only getGuardianForFloor was imported. Added getAllGuardianFloors to the existing import from @/lib/game/data/guardian-encounters. All 12 SpireSummaryTab tests pass.

Fixed: Added missing `getAllGuardianFloors` import to `SpireSummaryTab.tsx` line 7. The function was used in `useMemo` calls (lines 98-99) but never imported — only `getGuardianForFloor` was imported. Added `getAllGuardianFloors` to the existing import from `@/lib/game/data/guardian-encounters`. All 12 SpireSummaryTab tests pass.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Anexim/Mana-Loop#249