question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error on elm-language-server attach due to node higher than 16

See original GitHub issue

Previously I had a working config for neovim and elm-language-server. I’m not sure if the problem is in elm-language-server, node, or the neovim side.

Expected Behavior

Previous integration worked fine.

Current Behavior

[START][2022-05-18 08:47:05] LSP logging initiated
[ERROR][2022-05-18 08:47:10] .../vim/lsp/rpc.lua:420	"rpc"	"elm-language-server"	"stderr"	"(node:79362) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time\n(Use `node --trace-warnings ...` to show where the warning was created)\n"
[ERROR][2022-05-18 08:47:10] ...lsp/handlers.lua:454	"Unhandled Rejection at: Promise [object Promise] reason:, TypeError: Failed to parse URL from /Users/kremlan/.local/share/nvim/lsp_servers/elmls/node_modules/@elm-tooling/elm-language-server/node_modules/web-tree-sitter/tree-sitter.wasm"

I can confirm that the referenced tree-sitter.wasm location exists at that location.

Possible Solution

It seems unlikely that elm-language-server itself changed causing the break based on the date of the last release, but I have no idea when I had previously updated my installation. I can’t tell from the provided error message if this is a problem from within elmls, an incompatibility with a node upgrade, or an error occurring within neovim.

Steps to Reproduce (for bugs)

  1. Open any elm fine in neovim
  2. Introduce a syntax error
  3. Note that no LSP diagnostics are provided

Context

elm-language-server integration is now completely non-functional.

Your Environment

Neovim using lsp-config and lsp-installer. dotfiles available at https://github.com/bwells/dotfiles/tree/master/nvim

  • Version used: elm-language-server 2.2.1
  • Editor used: neovim 0.7
  • Environment name and version (e.g. node.js 5.4): Node v18.1.0
  • Operating System and version: macOS 12.4

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:18 (6 by maintainers)

github_iconTop GitHub Comments

4reactions
tillydraycommented, Jun 2, 2022

I’ve been able to track this down to a seeming incompatibility between elm-language-server and Node 18.x. Reverting node to 16.x has resolved the issue for me. Even more weirdly, the issue seems to resolve if I have both 18.x and 16.x installed locally with 18.x first in the path, but is reproducible if only 18.x is installed (via brew).

This fixed my problem 😄

  • macos 12.3.1
  • Doom Emacs 28.1
  • I had installed node via brew, so to downgrade I had to do brew uninstall --ignore-dependencies node && brew install node@16 && brew link node@16
2reactions
razzeeecommented, Dec 10, 2022

As far as I understood, it has been fixed in upstream, so we just need a release to happen on their side.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · elm-tooling/elm-language-server - GitHub
Disabling the MissingTypeAnnotation linting rule disabled the "Add inferred annotation" ... Error on elm-language-server attach due to node higher than 16.
Read more >
Error with node-sass when running npm install - Stack Overflow
If you're using Node 16, change node-sass to versions >= 6.0.1, then reinstalling the dependencies by npm i may fixed your problem.
Read more >
How To Install Node.js on Ubuntu 22.04 - DigitalOcean
In this guide, we will show you three different ways of getting Node.js installed on an Ubuntu 22.04 server: using apt to install...
Read more >
Download & Update Node.js to the Latest Version! Node v19 ...
Direct download links to update to the latest Node.js versions: Node v19.0.0 / LTS v16.18.0.
Read more >
Solving common issues with node-gyp - LogRocket Blog
Many node-gyp issues are actually issues with the toolchain used ... If an add-on code expects more or different functionality from V8 than...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found