sites
sites copied to clipboard
Getting `$app` module not found error for component which is using `sveltkit` in REPL
Can we add support for some of sveltekit internal API especially $app (https://kit.svelte.dev/docs#modules-$app-env) ?
Getting SvelteKit to work in the REPL is its own (quite large) project which we haven't begun to tackle yet, and in the meantime, I don't see much value in implementing various little pieces of it.
I am not saying we need add support sveltekit as a whole. Would prefer to have some of sveltekit modules available. https://kit.svelte.dev/docs#modules
Slowly when third party libs starts supporting sveltekit, they may end up using some of sveltekit modules. So if those modules are available directly in REPL, can be help for the community.
SvelteKit's modules aren't independent in the sense that we can extract parts of it out. They are tightly integrated with the framework, so the most we can do is to shim it, which doesn't feel right. And implementing only parts of it would be confusing. Not to mention that the modules API can have breaking changes, which can break existing REPLs.
agreed. So what should be right way to handle those? Should there be an exposed node module as a shim?
I think we should just not shim anything and keep the REPL vanilla. I'm not sure if it's worth the effort and instead could open a can of worms.
yea..not saying to add in REPL. was just thinking out loud if we can have a shim node module which will expose $app as a module available for import. That node module can be imported in REPL code wherever required.
Related SvelteKit issue: https://github.com/sveltejs/kit/issues/1485