[vite] warning: Could not resolve import "#runtime/svelte/component/core"
I haven't seen this error before.
WelcomeAppShell.svelte
Foundry v12, developing a new system.
Any clues?12 Replies
Isn't it supposed to be TJSApplicationShell?
Is it? I don't know tbh. Weird thing is this same code is working in my Actor Studio module but it doesn't want to work in my new system.
This is what i have. Ignore squiggly, it's because there's no .d.ts for that file.
Looking at the module, both exist, so I think it's more fundamental than that.
I tried
TJSApplicationShell
and the error shifted to [vite] warning: Could not resolve import "#runtime/svelte/helper"
, then I set it back to ApplicationShell
and the new error stays on.
And now it's shifted back to #runtime/svelte/component/core
– I have no idea what's going on 😦
Could it be a node version thing? I was on 18 but I just deleted node_modules
and yarn.lock
, switched to node 20 and got the same error.I run on node 20
Do you have the imports set up in package.json?
Yeah, I literally copied them from my last published (and working) module:
I meant this, but yeah probably not an issue if you copied the package.json
I don't have that no.
That seems to have worked. I didn't know about that as a requirement and, weirdly, my Actor Studio module is happily functioning without that 😅
Are you maybe using the full import in the other one?
oh wait... I tell a lie... it is in Actor Studio. Somehow I lost that when copying across.
Thank you @Bolts – i don't think I would have spotted that!
Thanks @Bolts for providing the
So in the case where one wants to explicitly control the styles of an app via the stock core theme use
imports
insight in regard to package.json
. From an end developer use case remapping packages in this way is a handy way to shorten the imports and also provides concise API docs.
About an unrelated comment regarding TJSApplicationShell
; this component is useful when you want to guarantee the stock look and feel of an app regardless of the game system theme / styles. Some game systems have pretty aggressive style overrides like Warhammer / wfrp4e
where the system theme will clash at times with the intended app UI / UX. TJSApplicationShell
ensures that the core theme is applied regardless of the game system theme or an alternate theming module. ApplicationShell
will adopt the system / theme module changes.So in the case where one wants to explicitly control the styles of an app via the stock core theme use
TJSApplicationShell
over ApplicationShell
.