Can't open more than one character sheet at a time

I'm having some trouble figuring out what's causing this behaviour. Any clues?
foundry.js:655 Error: An error occurred while rendering FF15ActorSheet 27. Cannot read properties of undefined (reading 'parentElement')
at Hooks.onError (foundry.js:654:24)
at 🎁call_wrapped [as call_wrapped] (libWrapper-wrapper.js:507:22)
at 🎁Hooks.onError#lib-wrapper (listeners.js:138:11)
at 🎁Hooks.onError#0 (libWrapper-wrapper.js:187:52)
at foundry.js:5795:13
Caused by: TypeError: Cannot read properties of undefined (reading 'parentElement')
at FF15ActorSheet._activateCoreListeners (foundry.js:6100:43)
at FF15ActorSheet._activateCoreListeners (SvelteApplication.js:229:13)
at FF15ActorSheet._render (foundry.js:5866:10)
at async FF15ActorSheet._render (SvelteApplication.js:886:7)
foundry.js:655 Error: An error occurred while rendering FF15ActorSheet 27. Cannot read properties of undefined (reading 'parentElement')
at Hooks.onError (foundry.js:654:24)
at 🎁call_wrapped [as call_wrapped] (libWrapper-wrapper.js:507:22)
at 🎁Hooks.onError#lib-wrapper (listeners.js:138:11)
at 🎁Hooks.onError#0 (libWrapper-wrapper.js:187:52)
at foundry.js:5795:13
Caused by: TypeError: Cannot read properties of undefined (reading 'parentElement')
at FF15ActorSheet._activateCoreListeners (foundry.js:6100:43)
at FF15ActorSheet._activateCoreListeners (SvelteApplication.js:229:13)
at FF15ActorSheet._render (foundry.js:5866:10)
at async FF15ActorSheet._render (SvelteApplication.js:886:7)
2 Replies
geoidesic
geoidesicOP3d ago
Ah.. a module error was obscuring things. Once all modules deactivated I'm seeing this:
SvelteApplication - _render: A DOM element already exists for CSS ID 'foundryvtt-final-fantasy--actor-sheet'. Cancelling initial render for new application with appId 'undefined'.
SvelteApplication - _render: A DOM element already exists for CSS ID 'foundryvtt-final-fantasy--actor-sheet'. Cancelling initial render for new application with appId 'undefined'.
Which I suppose relates to this:
static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, {
width: 440,
height: 828,
minWidth: 660,
id: `${SYSTEM_ID}--actor-sheet`, //<-- THIS
classes: [SYSTEM_CODE],
headerButtonNoLabel: game.settings.get(SYSTEM_ID, 'applicationWindowHeaderIconsOnly') || false,
dragDrop: [{ dragSelector: ".directory-list .item", dropSelector: null }],
svelte: {
class: ActorSheetShell,
target: document.body,
},
});
}
static get defaultOptions() {
return foundry.utils.mergeObject(super.defaultOptions, {
width: 440,
height: 828,
minWidth: 660,
id: `${SYSTEM_ID}--actor-sheet`, //<-- THIS
classes: [SYSTEM_CODE],
headerButtonNoLabel: game.settings.get(SYSTEM_ID, 'applicationWindowHeaderIconsOnly') || false,
dragDrop: [{ dragSelector: ".directory-list .item", dropSelector: null }],
svelte: {
class: ActorSheetShell,
target: document.body,
},
});
}
I'm a bit confused about how to handle that? What should I be doing here?
TyphonJS (Michael)
Are you using the same CSS ID on multiple sheets? This looks generic: 'foundryvtt-final-fantasy--actor-sheet' The check in SvelteApplication gives an explicit error in this case. CSS IDs need to be unique. Potentially you can use the document ID: foundryvtt-final-fantasy--actor-sheet-<DOC_ID>. If you are using IDs for styling it's better to use an additional class instead. Foundry core itself assigns a unique ID like app-1, app-2, app-N if you don't explicitly set an ID. I think various game systems take the appending of document ID approach. This is how the dnd5e system does actor sheet IDs: ActorSheet5eCharacter2-Actor-1uc7SH7pMWqkxsE3 You can see that the document ID is appended.
Want results from more Discord servers?
Add your server