Skip to content

Instantly share code, notes, and snippets.

@blaix
Last active October 21, 2023 10:42
Show Gist options
  • Save blaix/a709f0068ba0c022bb71c38f88d3045b to your computer and use it in GitHub Desktop.
Save blaix/a709f0068ba0c022bb71c38f88d3045b to your computer and use it in GitHub Desktop.
Troubleshooting issues with elm language server
  • Sometimes it just gets flat-out confused and needs to be restarted.
    • :lsp-restart in helix
    • Ctrl + Shift + P and search restart language language server in vscode
  • Are you using lamdera? or elm-pages (which uses the lamdera compiler)?
    • Tell your editor to use lamdera as the elm path/command.
    • Try lamdera reset
    • ...you may need to trigger a build afterwards (e.g. by loading site after lamdera live)
    • Try copying ~/.lamdera to ~/.elm (supposedly this will be fixed in a future version)
  • Sometimes setting up elm-tooling in the project will work when the global elm tools won't. Don't know why.
  • Check logs. Search google and elm channels (below) for errors.
    • visual studio code: open terminal pane and switch to "output" tab and select "elm" from the dropdown
    • helix: :log-open
  • Check #elm-language-server and #editors-and-ides channels in the elm-slack
  • Check elm-language-server --version and compare to elm-language-server repo
    • Compare your node version to the supported version according to the changelog
    • Try updating if not on the most recent version
    • If the latest version not working and there are unreleased fixes on main, try installing from source. Make sure your $PATH is set up so the version installed with npm link has higher precedence than the regular npm version. Check with type elm-language-server.
  • I'm not sure why this fixes it, but the past two times I've seen elm lsp fail with No workspaces contains X.elm, uninstalling and reinstalling elm-ui fixed it. Not sure if it's specific to elm ui, or because it was the last line in the direct dependencies.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment