Skip to content
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

Bug: Support Svelte 4 in @xstate/svelte #4105

Closed
danawoodman opened this issue Jun 28, 2023 · 8 comments · Fixed by #4128
Closed

Bug: Support Svelte 4 in @xstate/svelte #4105

danawoodman opened this issue Jun 28, 2023 · 8 comments · Fixed by #4128
Labels

Comments

@danawoodman
Copy link

Description

Installing @xstate/svelte with an app using Svelte v4 fails with

image

Expected result

It installs on Svelte 4

Actual result

It doesn't 😅

Reproduction

tried to with codesandbox but it kept crashing

Additional context

No response

@Andarist
Copy link
Member

It might be worth rechecking if we are affected anyhow by a breaking change from this PR: sveltejs/svelte#6750

@jer-0
Copy link
Contributor

jer-0 commented Jul 7, 2023

xstate is working fine for me in svelte 4.
is there are work around for this? I can't deploy my app.

@davidkpiano
Copy link
Member

xstate is working fine for me in svelte 4. is there are work around for this? I can't deploy my app.

Is the error you're getting the same as the original issue?

@jer-0
Copy link
Contributor

jer-0 commented Jul 7, 2023

xstate is working fine for me in svelte 4. is there are work around for this? I can't deploy my app.

Is the error you're getting the same as the original issue?

yes sir:

#0 10.77 npm ERR! While resolving: web-app@0.0.1
#0 10.77 npm ERR! Found: svelte@4.0.5
#0 10.77 npm ERR! node_modules/svelte
#0 10.77 npm ERR!   dev svelte@"^4.0.0" from the root project
#0 10.77 npm ERR!
#0 10.77 npm ERR! Could not resolve dependency:
#0 10.77 npm ERR! peer svelte@"^3.24.1" from @xstate/svelte@2.0.1
#0 10.77 npm ERR! node_modules/@xstate/svelte
#0 10.77 npm ERR!   @xstate/svelte@"^2.0.1" from the root project

@danawoodman
Copy link
Author

danawoodman commented Jul 7, 2023

I believe this line should change to something like:

"svelte": "^3.x || ^4.x",

@jer-0
Copy link
Contributor

jer-0 commented Jul 8, 2023

^3.24.1

I think this is better:

"svelte": "3.24.1 - 4"

ref: https://stackoverflow.com/a/60828558

jer-0 added a commit to jer-0/xstate that referenced this issue Jul 8, 2023
closes: statelyai#4105, make xstate-svelte compatible with svelte 4.
@danawoodman
Copy link
Author

danawoodman commented Jul 8, 2023

If the intent is to support 3 and 4, then doing 3 - 4 or 3 || 4 should be equivalent:

image

image

@jer-0
Copy link
Contributor

jer-0 commented Jul 9, 2023

it is currently "svelte": "^3.24.1", idk if there is support for below 3.24.1. Either way it will work I suppose.

Andarist added a commit that referenced this issue Jul 10, 2023
* Update package.json

closes: #4105, make xstate-svelte compatible with svelte 4.

* Update packages/xstate-svelte/package.json

* Create forty-knives-remain.md

---------

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants