sveltejs / kit

web development, streamlined
https://svelte.dev/docs/kit
MIT License
18.73k stars 1.94k forks source link

after migration to svelte 4: "cannot find module /.../node_modules/svelte/compiler" #10291

Closed m1027 closed 1 year ago

m1027 commented 1 year ago

Describe the bug

Hi,

this concerns coc-svelte, a neovim lsp plugin for svelte. The original error report is here [1], however with no progress.

The issue:

I've migrated my sveltekit projects from svelte 3 to 4 using the official guide [2]. After that, for each svelte file, I receive a global error message:

⚠ <script lang="ts">
Cannot find module '/home/user/src/my_project/node_modules/svelte/compiler'
Require stack:
- /home/user/.config/coc/extensions/node_modules/coc-svelte/node_modules/
svelte-language-server/dist/src/importPackage.js
- /home/user/.config/coc/extensions/node_modules/coc-svelte/node_modules/
svelte-language-server/dist/src/lib/documents/configLoader.js
- /home/user/.config/coc/extensions/node_modules/coc-svelte/node_modules/
svelte-language-server/dist/src/lib/documents/Document.js
- /home/user/.config/coc/extensions/node_modules/coc-svelte/node_modules/
svelte-language-server/dist/src/lib/documents/index.js
- /home/user/.config/coc/extensions/node_modules/coc-svelte/node_modules/
svelte-language-server/dist/src/server.js
- /home/user/.config/coc/extensions/node_modules/coc-svelte/node_modules/
svelte-language-server/bin/server.js (svelte)

When downgrading to svelte 3 the issue is gone.

Other users have the same issue.

Could anyone help tracking that down further? It may be a trivial thing.

Thanks

[1] https://github.com/coc-extensions/coc-svelte/issues/65 [2] https://svelte.dev/docs/v4-migration-guide

Reproduction

Always.

Logs

No response

System Info

Tested on linux, other users have the same issue.

Severity

blocking an upgrade

Additional Information

No response

dummdidumm commented 1 year ago

I'm closing this in favor of https://github.com/coc-extensions/coc-svelte/issues/65 - the problem is that coc-svelte uses an outdated version of the svelte-language-server - if it uses the latest one, the issue will go away.