sublimelsp / LSP-svelte

Convenience plugin for Svelte Language Tools

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: You must provide the URL of lib/mappings.wasm by calling SourceMapConsumer

easyfrog opened this issue · comments

I got these errors:

The error occurs on node 18.7.0 but works fine on node 10.16.0 and 16.8.0

image

Likely that https://github.com/sveltejs/language-tools is not compatible with Node 18. You can create an issue in https://github.com/sveltejs/language-tools

On our side we could implement a check for "too new" node version and show some more user friendly error in this case. There is a feature request for it already in sublimelsp/lsp_utils#89

@easyfrog to add on @rchl note.

One way to avoid hitting this issue and having to manually switch to node versions is to:

  1. Open the command palette and select Preferences: LSP Utils Settings,
  2. and modify the following setting:
{
    "nodejs_runtime": ["local"],
}

that will prompt you to install a local node version in Sublime Packages Folder(you do not need to know that).
That local node version will not affect your system.
LSP-* node based plugins will use that local node version, and thus you will not see this error anymore.

I view the codes in the error place. read-wasm.js first line.

image

I think the error because node 18 support fetch api, but there is not mappingsWasmUrl supply.
So I simply change the fist line to if (false) to avoid using fetch api. 😄