sdenec / tidy5e-sheet

An alternative Character Sheet for Foundry VTT dnd5e aimed at creating a cleaner UI.
86 stars 98 forks source link

[BUG] Some effects on PCs break the effects tab and subsequently the entire clickability of the sheet #813

Closed dschibster closed 2 months ago

dschibster commented 2 months ago

Module Version: v4.1.0

logging.ts:42 tidy5e-sheet | Failed to render svelte tab TypeError: Cannot read properties of undefined (reading 'parent')
    at Object.getEffectActor (foundry-adapter.ts:581:14)
    at Object.isEffectFavorited (foundry-adapter.ts:587:34)
    at Object.isActiveEffectContextFavorited (foundry-adapter.ts:576:27)
    at $$self.$$.update (EffectFavoriteControl.svelte:8:30)
    at init (Component.js:144:5)
    at new EffectFavoriteControl (EffectFavoriteControl.svelte:10:40)
    at construct_svelte_component (dom.js:1228:9)
    at Array.create_if_block$1x (ClassicControls.svelte:11:76)
    at create_each_block$V (ClassicControls.svelte:10:65)
    at create_fragment$3h (ClassicControls.svelte:9:9)
    at init (Component.js:148:34)
    at new ClassicControls (ClassicControls.svelte:5:14)
    at Array.create_default_slot_2$r (CharacterEffectsTab.svelte:167:73)
    at create_slot (utils.js:165:22)
    at create_fragment$3y (ItemTableColumn.svelte:5:40)
    at init (Component.js:148:34)
    at new ItemTableCell (ItemTableCell.svelte:19:25)
    at create_if_block_5$f (CharacterEffectsTab.svelte:164:51)
    at Array.create_default_slot_1$x (CharacterEffectsTab.svelte:166:107)
    at create_slot (utils.js:165:22)
    at create_fragment$3C (TidyHooks.ts:358:1)
    at init (Component.js:148:34)
    at new ItemTableRow (ItemTableRow.svelte:32:26)
    at create_each_block_1$g (CharacterEffectsTab.svelte:166:107)
    at Array.create_body_slot$9 (CharacterEffectsTab.svelte:121:21)
    at create_slot (utils.js:165:22)
    at Array.create_default_slot$1n (ExpandCollapseService.ts:74:1)
    at create_slot (utils.js:165:22)
    at create_fragment$3J (Traits.svelte:21:73)
    at init (Component.js:148:34)
    at new ExpandableContainer (ExpandableContainer.svelte:21:33)
    at create_fragment$3I (ItemTable.svelte:53:10)
    at init (Component.js:148:34)
    at new ItemTable (ItemTable.svelte:24:44)
    at create_if_block_3$q (CharacterEffectsTab.svelte:102:98)
    at create_if_block_2$x (CharacterEffectsTab.svelte:102:98)
    at create_each_block$w (CharacterEffectsTab.svelte:101:27)
    at Array.create_else_block$J (CharacterEffectsTab.svelte:100:11)
    at create_fragment$2t (CharacterEffectsTab.svelte:97:74)
    at init (Component.js:148:34)
    at new CharacterEffectsTab (CharacterEffectsTab.svelte:89:80)
    at TabContent.svelte:34:13
    at run (utils.js:41:9)
    at Array.map (<anonymous>)
    at Component.js:47:48
    at flush (scheduler.js:99:5)
    at init (Component.js:164:3)
    at new CharacterFeaturesTab (CharacterFeaturesTab.svelte:92:80)
    at TabContent.svelte:34:13
    at run (utils.js:41:9)
    at Array.map (<anonymous>)
    at Component.js:47:48
    at flush (scheduler.js:99:5)
    at init (Component.js:164:3)
    at new CharacterSpellbookTab (CharacterSpellbookTab.svelte:66:9)
    at TabContent.svelte:34:13
    at run (utils.js:41:9)
    at Array.map (<anonymous>)
    at Component.js:47:48
    at flush (scheduler.js:99:5)
    at init (Component.js:164:3)
    at new CharacterInventoryTab (CharacterInventoryTab.svelte:44:9)
    at TabContent.svelte:34:13
    at run (utils.js:41:9)
    at Array.map (<anonymous>)
    at Component.js:47:48
    at flush (scheduler.js:99:5)
    at init (Component.js:164:3)
    at new CharacterAttributesTab (CharacterAttributesTab.svelte:32:9)
    at TabContent.svelte:34:13
    at run (utils.js:41:9)
    at Array.map (<anonymous>)
    at Component.js:47:48
    at flush (scheduler.js:99:5)
    at init (Component.js:164:3)
    at new ActorActionsTab (ActorActionsTab.svelte:31:54)
    at TabContent.svelte:34:13
    at run (utils.js:41:9)
    at Array.map (<anonymous>)
    at Component.js:47:48
    at flush (scheduler.js:99:5)
    at init (Component.js:164:3)
    at new CharacterSheet (CharacterSheet.svelte:8:70)
    at Tidy5eCharacterSheet.activateListeners (Tidy5eCharacterSheet.ts:171:22)
    at Tidy5eCharacterSheet._render (foundry.js:5843:10)
    at async Tidy5eCharacterSheet._render (foundry.js:6548:5)
    at async Tidy5eCharacterSheet._render (foundry.js:7134:5)
    at async Tidy5eCharacterSheet._renderSheet (Tidy5eCharacterSheet.ts:1583:13)
    at async Tidy5eCharacterSheet.ts:1559:13
    at async mutex.ts:26:9

Describe the bug Applying certain effects from Spells to PC actors (for example the effect for Bless), the Effects tab doesn't get rendered and gives me the above error. Afterwards, sometimes the entire sheets breaks altogether, leaving me no choice but to switch to the default sheet to remove the effect, after which I am able to render everything normally again. The same thing happens when the caster drops concentration and the effect is removed automatically - then the Effects tab works properly agai,

To Reproduce

Expected behavior The Effects tab should render normally and show the effect

Screenshots image image

Browser: Brave (Chromium-based)

Foundry Version: 12 latest

Game System: DnD 5e latest

Additional context This only seems to come up on PC sheets. A monster that I had on my map that got the effect had it display properly.

kgar commented 2 months ago

This is the old Tidy repo from before I took over.

Try Tidy 4.4.1 and see if the problem persists. If there are still issues, let me know on https://github.com/kgar/foundry-vtt-tidy-5e-sheets/issues/

dschibster commented 2 months ago

My bad - thanks!

dschibster commented 2 months ago

Can actually confirm that the latest version does not have this issue. Thanks for reminding me to update!