sublimelsp / LSP-svelte

Convenience plugin for Svelte Language Tools
MIT License
16 stars 0 forks source link

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

Closed easyfrog closed 2 years ago

easyfrog commented 2 years ago

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
rchl commented 2 years ago

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 https://github.com/sublimelsp/lsp_utils/issues/89

predragnikolic commented 2 years ago

@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.

easyfrog commented 2 years ago

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. 😄