Vite + Codemirror in SvelteKit 4 broken due to @codemirror/state being loaded twice
I am trying to migrate the SvelteKit project from Node to Deno, and this issue is preventing me from switching over.
The npm modules installed alongside SvelteKit 4 needed to reproduce are
codemirror @codemirror/lang-json
I would imagine that being able to change the .deno
directory to somewhere outside of node_modules
would fix this.
This is the error received in the browser on load:
Error: Unrecognized extension value in extension set ([object Object]). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.
The 2 instances being loaded in the browser are at:
node_modules/@codemirror/state/dist/index.js
node_modules/.deno/@codemirror+state@6.5.2/node_modules/@codemirror/state/dist
This is running in the denoland/deno:alpine docker container.
Deno version (in the container):
I have tried to deny .deno in vite.config.js in server/fs/deny. Neither denying node_modules/.deno or denying .deno work.
3 Replies
You can reproduce this by setting up the basic codemirror editor within a +page.svelte. This page is a stripped-down version of what I have.
Can you file an issue for that here https://github.com/denoland/deno-vite-plugin/issues ? It's much easier to track issues for us on GitHub than in discord
GitHub
Issues · denoland/deno-vite-plugin
Vite plugin to enable Deno resolution inside vite. - Issues · denoland/deno-vite-plugin
I created it. Thank you!
https://github.com/denoland/deno/issues/28326
GitHub
Vite + Codemirror in SvelteKit 4 broken due to @codemirror/state be...
Version: docker denoland/deno:alpine deno 2.2.2 (stable, release, x86_64-unknown-linux-gnu) v8 13.4.114.9-rusty typescript 5.7.3 I am trying to migrate the SvelteKit project from Node to Deno, and ...