You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Open the folder you cloned into in VS Code or any other editor
There should be 2 folders, app and studio. Using terminal, cd into the app folder.
Run 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.
Set the following dev dependancies in package.json - "@sveltejs/vite-plugin-svelte": "^3.1.2" and "svelte": "^4.2.19"
Run npm install - no errors should be reported
Run npm run dev and the dev server should start with no issues
Quit the dev server
Run npx npm-check-updates -u again. this will upgrade @sveltejs/vite-plugin-svelte and svelte in dev dependancies to support Svelte 5
Run npm 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 deps
Run npm 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:
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: