bash-language-server: The "languageserver.bash" server crashed 4 times in the last 3 minutes. The server will not be restarted

Opening a .sh file in neovim and waiting around 4 seconds leads to this issue. The language server crashes and doesn’t work whatsoever. I have tried reinstalling node, bash-language-server and coc multiple times with no success.

This started happening a few days ago, don’t think I have changed anything. This is the output of :CocCommand workspace.showOuptut:

node:internal/deps/undici/undici:4816
            throw new TypeError("Failed to parse URL from " + input, { cause: err });
                  ^

TypeError: Failed to parse URL from /usr/lib/node_modules/bash-language-server/node_modules/web-tree-sitter/tree-sitter.wasm
    at new Request (node:internal/deps/undici/undici:4816:19)
    at Agent2.fetch2 (node:internal/deps/undici/undici:5544:29)
    ... 4 lines matching cause stack trace ...
    at /usr/lib/node_modules/bash-language-server/node_modules/web-tree-sitter/tree-sitter.js:1:144
    at Object.<anonymous> (/usr/lib/node_modules/bash-language-server/node_modules/web-tree-sitter/tree-sitter.js:1:170)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1159:10) {
  [cause]: TypeError [ERR_INVALID_URL]: Invalid URL
      at new NodeError (node:internal/errors:377:5)
      at URL.onParseError (node:internal/url:563:9)
      at new URL (node:internal/url:643:5)
      at new Request (node:internal/deps/undici/undici:4814:25)
      at Agent2.fetch2 (node:internal/deps/undici/undici:5544:29)
      at Object.fetch (node:internal/deps/undici/undici:6372:20)
      at fetch (node:internal/bootstrap/pre_execution:199:25)
      at /usr/lib/node_modules/bash-language-server/node_modules/web-tree-sitter/tree-sitter.js:1:15041
      at /usr/lib/node_modules/bash-language-server/node_modules/web-tree-sitter/tree-sitter.js:1:15262
      at /usr/lib/node_modules/bash-language-server/node_modules/web-tree-sitter/tree-sitter.js:1:144 {
    input: '/usr/lib/node_modules/bash-language-server/node_modules/web-tree-sitter/tree-sitter.wasm',
    code: 'ERR_INVALID_URL'
  }
}

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 9
  • Comments: 22 (1 by maintainers)

Commits related to this issue

Most upvoted comments

Version 3.0.3 has just been released with a workaround. Let me know if it works. 😃

I have the same problem. A temporary solution for me is to downgrade nodejs from 18.1.0 to 17.9.0 on Arch Linux…

Thank you!

3.0.3 wfm as well. Thank you.

Yes, 3.0.3 works, thank you for fixing it!

Version 3.0.3 works for me with node 18.2.0

I have the same problem. A temporary solution for me is to downgrade nodejs from 18.1.0 to 17.9.0 on Arch Linux…

This worked for me too. Probably a bug in nodejs 18.1 then