BUG: Enchanter/Invoker/Fabricator discipline categories may also crash like Elemental #247
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
Expected Behavior
Each category should show its respective disciplines:
Impact
Files Involved
src/components/game/tabs/DisciplinesTab.tsx— category filtering logicsrc/components/game/tabs/DisciplineCard.tsx— discipline card renderingStarting investigation of discipline category crash bug. Will examine DisciplinesTab.tsx and DisciplineCard.tsx for the
.includes()error on undefined values.Root Cause
The
ElementalDisciplineGroupcomponent inElementalSubtab.tsxdid not receive or pass theactiveIdsprop toDisciplineCard. SinceDisciplineCardrequiresactiveIds: string[]and callsactiveIds.includes(id)on line 44, the missing prop causedTypeError: Cannot read properties of undefined (reading 'includes').The non-elemental tabs (Base, Enchanter, Fabricator, Invoker) were unaffected because they use
CardWrapperwhich correctly passes all required props.Fix Applied
src/components/game/tabs/ElementalSubtab.tsx:activeIds: string[]toSharedRenderPropsinterfaceactiveIdsthroughElementalSubtab→ElementalDisciplineGroup→DisciplineCardsrc/components/game/tabs/DisciplinesTab.tsx:activeIds={activeIds}to the<ElementalSubtab>JSX propssrc/lib/game/utils/discipline-math.ts: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
2539559pushed to master