🐛 Stats tab does not load #118
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
The Stats tab fails to load when clicked.
Root Cause
StatsTab.tsxpasses a largeupgradeEffectsobject toManaStatsSectionthat includes many fields not present on theComputedEffectstype (fromsrc/lib/game/effects/upgrade-effects.types.ts). TheManaStatsSectioncomponent'sManaStatsEffectsinterface extendsComputedEffectswith additional fields likeincursionStrength,rawMana,hasSteadyStream,hasManaTorrent,hasDesperateWells,manaCascadeBonus,manaWaterfallBonus,hasFlowSurge,hasManaOverflow,hasEternalFlow.However, the
useManaStats()hook insrc/lib/game/hooks/useGameDerived.tsreturns these as top-level properties (e.g.,hasSteadyStream,manaCascadeBonus, etc.) — they are NOT nested insideupgradeEffects. TheStatsTabincorrectly spreads them into theupgradeEffectsprop:This creates a type mismatch. The
ManaStatsSectioncomponent then accessesupgradeEffects.hasSteadyStreametc. which may work at runtime but the real issue is that theComputedEffectstype doesn't declare these fields, causing TypeScript compilation errors that prevent the tab from loading.Additionally,
LoopStatsSection.tsxreadsmemorySlotsfromusePrestigeStore((s) => s.memorySlots)— if this store property is missing or undefined, it could also cause a crash.Files Involved
src/components/game/tabs/StatsTab.tsxsrc/components/game/tabs/StatsTab/ManaStatsSection.tsxsrc/components/game/tabs/StatsTab/LoopStatsSection.tsxsrc/lib/game/hooks/useGameDerived.tssrc/lib/game/effects/upgrade-effects.types.tsSuggested Fix
Either:
ComputedEffectstype and haveuseManaStats()return them insideupgradeEffects, ORManaStatsSectioninstead of merging them intoupgradeEffects.✅ Fixed. Changes made:
ManaStatsEffects extends ComputedEffectsinterface to a flatManaStatsSectionPropswith all special effect flags as separate props (not merged intoupgradeEffects)manaStats.upgradeEffectsdirectly (pureComputedEffects) and passes special effect flags as separate props instead of manually merging them into a single objectThis eliminates the type mismatch where non-
ComputedEffectsfields were being spread into theupgradeEffectsprop.✅ Fixed Stats tab type mismatch by passing special effect flags as separate props instead of merging into upgradeEffects