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.

LS cannot find packages when using Docker

See original GitHub issue

Upon opening an Elm file with v2 of the language server I get:

The Elm server crashed 5 times in the last 3 minutes. The server will not be restarted.

The last part of the output is

TypeError: Cannot read property 'synchronize' of undefined
/home/sebastian/.vscode/extensions/elmtooling.elm-ls-vscode-2.0.0/server/node_modules/web-tree-sitter/tree-sitter.js:1
var Module=void 0!==Module?Module:{};!function(e,t){"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?module.exports=t():window.TreeSitter=t()}(0,function(){var e,t={};for(e in Module)Module.hasOwnProperty(e)&&(t[e]=Module[e]);var r,n,s=[],o=function(e,t){throw t},_=!1,a=!1;_="object"==typeof window,a="function"==typeof importScripts,r="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,n=!_&&!r&&!a;var i,u,l,d,c="";r?(c=a?require("path").dirname(c)+"/":__dirname+"/",i=function(e,t){return l||(l=require("fs")),d||(d=require("path")),e=d.normalize(e),l.readFileSync(e,t?null:"utf8")},u=function(e){var t=i(e,!0);return t.buffer||(t=new Uint8Array(t)),L(t.buffer),t},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),s=process.argv.slice(2),"undefined"!=typeof module&&(module.exports=Module),process.on("uncaughtExce

RuntimeError: abort(TypeError: Cannot read property 'synchronize' of undefined). Build with -s ASSERTIONS=1 for more info.
    at process.fe (/home/sebastian/.vscode/extensions/elmtooling.elm-ls-vscode-2.0.0/server/node_modules/web-tree-sitter/tree-sitter.js:1:10450)
    at process.emit (events.js:228:7)
    at processPromiseRejections (internal/process/promises.js:201:33)
    at processTicksAndRejections (internal/process/task_queues.js:95:32)
[Error - 11:59:53 am] Connection to server got closed. Server will not be restarted.
[Error - 11:59:53 am] Request textDocument/documentSymbol failed.
Error: Connection got disposed.
	at Object.dispose (/home/sebastian/.vscode/extensions/elmtooling.elm-ls-vscode-2.0.0/client/node_modules/vscode-jsonrpc/lib/common/connection.js:1044:27)
	at Object.dispose (/home/sebastian/.vscode/extensions/elmtooling.elm-ls-vscode-2.0.0/client/node_modules/vscode-languageclient/lib/common/client.js:73:35)
	at LanguageClient.handleConnectionClosed (/home/sebastian/.vscode/extensions/elmtooling.elm-ls-vscode-2.0.0/client/node_modules/vscode-languageclient/lib/common/client.js:2424:42)
	at LanguageClient.handleConnectionClosed (/home/sebastian/.vscode/extensions/elmtooling.elm-ls-vscode-2.0.0/client/node_modules/vscode-languageclient/lib/node/main.js:155:15)
	at closeHandler (/home/sebastian/.vscode/extensions/elmtooling.elm-ls-vscode-2.0.0/client/node_modules/vscode-languageclient/lib/common/client.js:2411:18)
	at CallbackList.invoke (/home/sebastian/.vscode/extensions/elmtooling.elm-ls-vscode-2.0.0/client/node_modules/vscode-jsonrpc/lib/common/events.js:55:39)
	at Emitter.fire (/home/sebastian/.vscode/extensions/elmtooling.elm-ls-vscode-2.0.0/client/node_modules/vscode-jsonrpc/lib/common/events.js:117:36)
	at closeHandler (/home/sebastian/.vscode/extensions/elmtooling.elm-ls-vscode-2.0.0/client/node_modules/vscode-jsonrpc/lib/common/connection.js:256:26)
	at CallbackList.invoke (/home/sebastian/.vscode/extensions/elmtooling.elm-ls-vscode-2.0.0/client/node_modules/vscode-jsonrpc/lib/common/events.js:55:39)
	at Emitter.fire (/home/sebastian/.vscode/extensions/elmtooling.elm-ls-vscode-2.0.0/client/node_modules/vscode-jsonrpc/lib/common/events.js:117:36)
	at IPCMessageReader.fireClose (/home/sebastian/.vscode/extensions/elmtooling.elm-ls-vscode-2.0.0/client/node_modules/vscode-jsonrpc/lib/common/messageReader.js:40:27)
	at ChildProcess.<anonymous> (/home/sebastian/.vscode/extensions/elmtooling.elm-ls-vscode-2.0.0/client/node_modules/vscode-jsonrpc/lib/node/main.js:33:45)
	at ChildProcess.emit (events.js:228:7)
	at maybeClose (internal/child_process.js:1021:16)
	at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
[Error - 11:59:53 am] Request textDocument/codeAction failed.
Error: Connection got disposed.
	at Object.dispose (/home/sebastian/.vscode/extensions/elmtooling.elm-ls-vscode-2.0.0/client/node_modules/vscode-jsonrpc/lib/common/connection.js:1044:27)
	at Object.dispose (/home/sebastian/.vscode/extensions/elmtooling.elm-ls-vscode-2.0.0/client/node_modules/vscode-languageclient/lib/common/client.js:73:35)
	at LanguageClient.handleConnectionClosed (/home/sebastian/.vscode/extensions/elmtooling.elm-ls-vscode-2.0.0/client/node_modules/vscode-languageclient/lib/common/client.js:2424:42)
	at LanguageClient.handleConnectionClosed (/home/sebastian/.vscode/extensions/elmtooling.elm-ls-vscode-2.0.0/client/node_modules/vscode-languageclient/lib/node/main.js:155:15)
	at closeHandler (/home/sebastian/.vscode/extensions/elmtooling.elm-ls-vscode-2.0.0/client/node_modules/vscode-languageclient/lib/common/client.js:2411:18)
	at CallbackList.invoke (/home/sebastian/.vscode/extensions/elmtooling.elm-ls-vscode-2.0.0/client/node_modules/vscode-jsonrpc/lib/common/events.js:55:39)
	at Emitter.fire (/home/sebastian/.vscode/extensions/elmtooling.elm-ls-vscode-2.0.0/client/node_modules/vscode-jsonrpc/lib/common/events.js:117:36)
	at closeHandler (/home/sebastian/.vscode/extensions/elmtooling.elm-ls-vscode-2.0.0/client/node_modules/vscode-jsonrpc/lib/common/connection.js:256:26)
	at CallbackList.invoke (/home/sebastian/.vscode/extensions/elmtooling.elm-ls-vscode-2.0.0/client/node_modules/vscode-jsonrpc/lib/common/events.js:55:39)
	at Emitter.fire (/home/sebastian/.vscode/extensions/elmtooling.elm-ls-vscode-2.0.0/client/node_modules/vscode-jsonrpc/lib/common/events.js:117:36)
	at IPCMessageReader.fireClose (/home/sebastian/.vscode/extensions/elmtooling.elm-ls-vscode-2.0.0/client/node_modules/vscode-jsonrpc/lib/common/messageReader.js:40:27)
	at ChildProcess.<anonymous> (/home/sebastian/.vscode/extensions/elmtooling.elm-ls-vscode-2.0.0/client/node_modules/vscode-jsonrpc/lib/node/main.js:33:45)
	at ChildProcess.emit (events.js:228:7)
	at maybeClose (internal/child_process.js:1021:16)
	at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)

The whole output is here https://gist.github.com/sporto/9a35f5caa1184807ea9d12412fcadac7

Current Behavior

Language server crashes

Steps to Reproduce (for bugs)

  1. Install language server v2
  2. Open an Elm file

Your Environment

  • VScode 1.52.1
  • Node 14.15.1
  • Linux pop-os 20.10

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
sportocommented, Jan 20, 2021

With docker compose doing this fixes the issue:

client:
    ...
    volumes:
      ...
      - ~/.elm:/root/.elm

Then Elm will put packages on the host and the language server works.

I’m not sure if the LS can do anything about this. Maybe just document this issue.

0reactions
razzeeecommented, Jan 22, 2021

I’m going to close this then. Feel free to ping, if this should be opened up again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Build Docker with Go app: cannot find package - Stack Overflow
Install dependencies, I used go get but replace it with which ever dependency ... You can run ls or any other command using...
Read more >
Install on Ubuntu - Docker Desktop
Install Docker Desktop · Set up Docker's package repository. · Download latest DEB package. · Install the package with apt as...
Read more >
Using the official AWS CLI version 2 Amazon ECR Public ...
For more information on how to use Docker, see. ... when running the s3 ls command to list your buckets in Amazon Simple...
Read more >
Why new Macs break your Docker build, and how to fix it
Why do we need a compiler on the Mac, but not on Linux? Symptom #2: Missing packages. Let's try a different Dockerfile :...
Read more >
How to Install Linux Packages Inside a Docker Container?
In this article, we will see how to install packages and libraries inside Docker Containers using 2 different methods.
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