BUG: Enchanter/Invoker/Fabricator discipline categories may also crash like Elemental #247

Closed
opened 2026-06-01 10:48:47 +02:00 by Anexim · 2 comments
Owner

Bug Description

After discovering that the "Elemental" discipline category crashes with TypeError: Cannot read properties of undefined (reading 'includes'), the same bug likely affects the "Enchanter", "Fabricator", and "Invoker" discipline categories since they use the same rendering code path.

Steps to Reproduce

  1. Open the Disciplines tab
  2. Click "Enchanter", "Fabricator", or "Invoker" category buttons
  3. Observe: likely same crash as Elemental category

Expected Behavior

Each category should show its respective disciplines:

  • Enchanter: Enchantment Crafting, Mana Channeling, Study Basic/Advanced/Utility/Mana/Spell Enchantments
  • Fabricator: Golem Crafting, Crafting Efficiency, Study Fabricator/Wizard/Physical Equipment
  • Invoker: Pact Attunement, Guardian's Boon

Impact

  • 4 out of 5 discipline categories may be completely inaccessible
  • Player cannot view or activate 60+ disciplines

Files Involved

  • src/components/game/tabs/DisciplinesTab.tsx — category filtering logic
  • src/components/game/tabs/DisciplineCard.tsx — discipline card rendering
## Bug Description After discovering that the "Elemental" discipline category crashes with `TypeError: Cannot read properties of undefined (reading 'includes')`, the same bug likely affects the "Enchanter", "Fabricator", and "Invoker" discipline categories since they use the same rendering code path. ## Steps to Reproduce 1. Open the Disciplines tab 2. Click "Enchanter", "Fabricator", or "Invoker" category buttons 3. Observe: likely same crash as Elemental category ## Expected Behavior Each category should show its respective disciplines: - Enchanter: Enchantment Crafting, Mana Channeling, Study Basic/Advanced/Utility/Mana/Spell Enchantments - Fabricator: Golem Crafting, Crafting Efficiency, Study Fabricator/Wizard/Physical Equipment - Invoker: Pact Attunement, Guardian's Boon ## Impact - 4 out of 5 discipline categories may be completely inaccessible - Player cannot view or activate 60+ disciplines ## Files Involved - `src/components/game/tabs/DisciplinesTab.tsx` — category filtering logic - `src/components/game/tabs/DisciplineCard.tsx` — discipline card rendering
Anexim added the ai:todo label 2026-06-01 10:48:47 +02:00
n8n-gitea was assigned by Anexim 2026-06-01 10:48:47 +02:00
Author
Owner

Starting investigation of discipline category crash bug. Will examine DisciplinesTab.tsx and DisciplineCard.tsx for the .includes() error on undefined values.

Starting investigation of discipline category crash bug. Will examine DisciplinesTab.tsx and DisciplineCard.tsx for the `.includes()` error on undefined values.
Author
Owner

Root Cause

The ElementalDisciplineGroup component in ElementalSubtab.tsx did not receive or pass the activeIds prop to DisciplineCard. Since DisciplineCard requires activeIds: string[] and calls activeIds.includes(id) on line 44, the missing prop caused TypeError: Cannot read properties of undefined (reading 'includes').

The non-elemental tabs (Base, Enchanter, Fabricator, Invoker) were unaffected because they use CardWrapper which correctly passes all required props.

Fix Applied

src/components/game/tabs/ElementalSubtab.tsx:

  • Added activeIds: string[] to SharedRenderProps interface
  • Threaded activeIds through ElementalSubtabElementalDisciplineGroupDisciplineCard

src/components/game/tabs/DisciplinesTab.tsx:

  • Added activeIds={activeIds} to the <ElementalSubtab> JSX props

src/lib/game/utils/discipline-math.ts:

  • Added 8 missing mana type names to MANA_TYPE_NAMES (frost, blackflame, radiantflames, miasma, shadowglass, soul, time, plasma) — these were causing composite/exotic conversion disciplines to show raw IDs instead of proper names in prerequisite checks.

Verification

  • All 900 tests pass (44 test files)
  • Pre-commit checks pass (file sizes, circular deps)
  • Commit 2539559 pushed to master
## Root Cause The `ElementalDisciplineGroup` component in `ElementalSubtab.tsx` did **not** receive or pass the `activeIds` prop to `DisciplineCard`. Since `DisciplineCard` requires `activeIds: string[]` and calls `activeIds.includes(id)` on line 44, the missing prop caused `TypeError: Cannot read properties of undefined (reading 'includes')`. The non-elemental tabs (Base, Enchanter, Fabricator, Invoker) were unaffected because they use `CardWrapper` which correctly passes all required props. ## Fix Applied **`src/components/game/tabs/ElementalSubtab.tsx`:** - Added `activeIds: string[]` to `SharedRenderProps` interface - Threaded `activeIds` through `ElementalSubtab` → `ElementalDisciplineGroup` → `DisciplineCard` **`src/components/game/tabs/DisciplinesTab.tsx`:** - Added `activeIds={activeIds}` to the `<ElementalSubtab>` JSX props **`src/lib/game/utils/discipline-math.ts`:** - Added 8 missing mana type names to `MANA_TYPE_NAMES` (`frost`, `blackflame`, `radiantflames`, `miasma`, `shadowglass`, `soul`, `time`, `plasma`) — these were causing composite/exotic conversion disciplines to show raw IDs instead of proper names in prerequisite checks. ## Verification - All 900 tests pass (44 test files) - Pre-commit checks pass (file sizes, circular deps) - Commit `2539559` pushed to master
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Anexim/Mana-Loop#247