Cannot open Application after TJSDialog
13 Replies
The follow on error you posted in #dev-lounge is likely due to the rejection on render for the duplicated IDs. Are you sure the data for TJSDialog.wait and the other application doesn't use the same CSS ID in application / dialog options?
TJSDialog.wait
has bare minimum data provided to it, quite frankly
https://github.com/MrVauxs/vauxs-archives/blob/6a82c6e3fb962bc332ef50bd00bbfc043f2ec541/src/view/createArchive.js#L44-L50here is how it looks
You reuse the ID
vauxs-archive
several times in different elements in:
- src/view/Searchbar.svelte
.
- src/view/ArchiveEditor.svelte
- src/view/ArchiveCreator.svelte
and in an Application: src/view/ArchiveApplication.js
Just did a quick search of your code base...
There must be only one visible element with the same CSS ID at a time.
The ID should be unique to a specific app otherwise use CSS classes to share styles across your package.Annoying, but fair
If those components listed are all part of ArchiveApplication then you don't need the ID applied as it will already be applied to the main app div element.
They are not, but fixed it anyway
I was using the ID, improperly, as a selector
basically
now it all works
Interesting error condition though with the actual exception which is likely caused with the use of
TJSDialog.wait
. The CSS ID check in SvelteApplication.render
normally stops follow on errors / explosion from occurring and rejects the render, but I've only tested this when opening normal applications that share IDs. IE the ideal is just getting the warning message and not the exception / explosion after things don't get setup correctly.
My guess perhaps those components were used in the TJSDialog and then subsequently launching a new app choked.The components are only used in those functions and not called or rendered anywhere else 🤷
Sidenote: I recommend looking at the github release action I have
You may be interested in using it as a template
Including the fact it finally has no Node 16 deprecation warnings
I'll definitely make sure things have latest action dependencies. Hard to say if all of the extra stuff like publishing to Foundry is useful out of the gate. Perhaps taking a look at it and commenting it out, but probably better to keep that in a dev guide that is updated vs just commented out in code.
Indeed some aspects would be nice to clean up in the Vite config and such. I'll likely be creating a streamlined CLI for Foundry / TRL soon for standard setup aspects.