Replies: 1 comment
-
I would probably export |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to upgrade my code from Svelte 4 to Svelte 5, but I am running into trouble.
I am generating a JavaScript snipped on the server side and then use that to instantiate a pre-compiled Svelte 4 component that is loaded from
url
like this (the code is Java, the return value is the JavaScript snippet):Rendered, it looks like this:
However, with Svelte 5, I get the error that components can no longer be instantiated using
new
. I have already tried enabling the Svelte 4 Component API compatibility mode insvelte.config.js
but to no avail.What is the correct way to programmatically instantiate a Svelte 5 component from plain JS?
Searching for a solution, I found advice to use
mount
or similar calls that need to be imported from svelte, but at the point this code is running, I have no way of importing stuff from svelte anymore. I need to rely on what has been packaged into the (minified) JS bundle.Beta Was this translation helpful? Give feedback.
All reactions