sveltejs / language-tools

The Svelte Language Server, and official extensions which use it
MIT License
1.25k stars 198 forks source link

Missing module `./utils` in VSCode Plugin #1296

Closed hmajid2301 closed 2 years ago

hmajid2301 commented 2 years ago

Describe the bug A clear and concise description of what the bug is.

I get the following error when VSCode starts up:

The Svelte server crashed 5 times in the last 3 minutes. The server will not be restarted.

To Reproduce Start VSCode (or restart Svelte language server). With the following versions

Node Verion: lts/fermium (v14.18.2)
VSCode Version: 1.63.2
Svelte for VSCode Version: v105.8.0

Expected behavior For Svelte server to startup without issue

Screenshots If applicable, add screenshots to help explain your problem.

System (please complete the following information):

Additional context Add any other context about the problem here.

[Trace - 00:46:30] Sending request 'shutdown - (1)'.
internal/modules/cjs/loader.js:937
  throw err;
  ^

Error: Cannot find module './utils'
Require stack:
....
- /home/haseeb/.vscode/extensions/svelte.svelte-vscode-105.8.0/node_modules/svelte-language-server/bin/server.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:934:15)
    at Module._load (internal/modules/cjs/loader.js:779:27)
    at Function.f._load (electron/js2c/asar_bundle.js:5:12913)
    at Module.require (internal/modules/cjs/loader.js:1006:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/home/haseeb/.vscode/extensions/svelte.svelte-vscode-105.8.0/node_modules/svelte-language-server/dist/src/plugins/typescript/features/CodeActionsProvider.js:14:17)
    at Module._compile (internal/modules/cjs/loader.js:1125:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1155:10)
    at Module.load (internal/modules/cjs/loader.js:982:32)
    at Module._load (internal/modules/cjs/loader.js:823:14) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/haseeb/.vscode/extensions/svelte.svelte-vscode-105.8.0/node_modules/svelte-language-server/dist/src/plugins/typescript/features/CodeActionsProvider.js',
    '/home/haseeb/.vscode/extensions/svelte.svelte-vscode-105.8.0/node_modules/svelte-language-server/dist/src/plugins/typescript/TypeScriptPlugin.js',
    '/home/haseeb/.vscode/extensions/svelte.svelte-vscode-105.8.0/node_modules/svelte-language-server/dist/src/plugins/index.js',
    '/home/haseeb/.vscode/extensions/svelte.svelte-vscode-105.8.0/node_modules/svelte-language-server/dist/src/server.js',
    '/home/haseeb/.vscode/extensions/svelte.svelte-vscode-105.8.0/node_modules/svelte-language-server/bin/server.js'
  ]
}

Discord thread for context: https://discord.com/channels/457912077277855764/689494103380983930/924101926252056657

hmajid2301 commented 2 years ago

I was able to fix this by doing:

Then I started to receive another weird error about function scope 0 already existing or something like that (command 'function_scope_0' already exists) I then did:

Now the server seems to be running

dummdidumm commented 2 years ago

I can't reproduce this on my end when doing a fresh install of the extension. This might have been a hickup from VS Code not downloading all files or sth like that. I'll let you know when there's another release of the extension, then you can check if that new version installs without problems.

dummdidumm commented 2 years ago

A new version was released, could you check if it works without your workaround now?

dummdidumm commented 2 years ago

Closing as I hope the issue is resolved and I also think that this is nothing we can fix on our end, sounds like an error in VS Code or its servers.