-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[xstate/svelte] bundling of @xstate/svelte/lib/fsm with sveltekit & vite is broken #2458
Comments
I just made it work with the description from: But contrary to the description the |
@floratmin |
No that's right I use it with SvelteKit. |
This comment has been minimized.
This comment has been minimized.
No I use it with the full xstate package, I tried it also with |
This comment has been minimized.
This comment has been minimized.
I just replaced |
This comment has been minimized.
This comment has been minimized.
@benbender This could related sveltejs/kit#928 |
This comment has been minimized.
This comment has been minimized.
@benbender What happens when you run |
Oh sh*t. You're right... Its still broken - my memory betrayed me as I thought that it broke when building. sorry for the noise! Btw, my old workaround:
Works for now even if its not pretty... |
No problem :) Thanks for confirming! With your workaround we have two possible solutions now! Good. 👍 |
It's best to used named imports instead of default imports for this reason. Then it will work the same with both ESM and CJS |
Description
If I create a new sveltekit-app:
npm init svelte@next xstate-sveltekit-repro
npm i && npm add @xstate/svelte @xstate/fsm
@xstate/svelte/lib/fsm
from the docs @ https://xstate.js.org/docs/packages/xstate-svelte/#usemachine-machine-with-xstate-fsmnpm run build
npm preview
I get the following error:
Expected Result
The app should run with the production build.
Actual Result
@xstate/svelte/lib/fsm
can't be importedReproduction
see above.
Additional context
@xstate/svelte
package doesn't seem to use rollup for bundling like the rest of the packages in this repo. Any reason for that?The text was updated successfully, but these errors were encountered: