-
Notifications
You must be signed in to change notification settings - Fork 25
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
Svelte 5 breaks @sanity/visual-editing and thus also @sanity/svelte-loader #2075
Comments
I'm not able to recreate this in a Svelte 5 app, everything works as expected. Can you verify React has been installed as a peer dependency? React is used by the Visual Editing package to render overlays. |
I have the same issue with svelte 5 Edit: Have to use --force to get the peer depedencies. |
Current workaround seems indeed to use |
+1 currently using |
Live Edit seems to not work with Svelte 5 (using --force at install) |
@rdunk Any updates on this? |
Hi all, first of all thanks for all the great work you do.
Describe the bug
After updating a sveltekit project to svelte 5 - which is now released in production - it seems impossible to use
@sanity/svelte-loader
and@sanity/visual-editing
despite svelte 5 being backwards compatible with svelte 4 code.To Reproduce
Steps to reproduce the behavior:
npx npm-check-updates -u
to update all of the package.json dependancies to latest. This step will have updated the package.json to Svelte 5 - we DO NOT want that just yet so we will downgrade back to svelte 4.npm install
- no errors should be reportednpm run dev
and the dev server should start with no issuesnpx npm-check-updates -u
again. this will upgrade @sveltejs/vite-plugin-svelte and svelte in dev dependancies to support Svelte 5npm install --legacy-peer-deps
- we require the legacy peer deps flag as sanity svelte code doesn't include v4 of vite-plugin-svelte in the peer depsnpm run dev
and the dev server will fail to start with react errors. I don't know why it is even trying to run react code at all?Expected behavior
The dev server should start without issue as it did with svelte 4.
Screenshots
These are the error messages after starting the dev server in step 11 above:
Which versions of Sanity are you using?
@sanity/cli (global) 3.59.0 (latest: 3.62.3)
@sanity/image-url 1.1.0 (up to date)
@sanity/svelte-loader 1.12.8 (up to date)
@sanity/types 3.62.3 (up to date)
@sanity/visual-editing 2.4.2 (up to date)
What operating system are you using?
Mac OSX Sonoma 14.6.1
Which versions of Node.js / npm are you running?
npm: 10.9.0
node: v20.11.1
Additional context
This wouldn't be such a major problem if we could simply temporarily uninstall the @sanity/visual-editing dependancy until there is a solution, but as the file previewStore.js in the @sanity svelte-loader package dist folder references @sanity/visual-editing, uninstalling the @sanity/visual-editing dependancy simply won't let the @sanity svelte-loader package run.
Many thanks
The text was updated successfully, but these errors were encountered: