Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught error - Connection got disposed #42

Open
andrew-paterson opened this issue Apr 5, 2023 · 13 comments
Open

Uncaught error - Connection got disposed #42

andrew-paterson opened this issue Apr 5, 2023 · 13 comments

Comments

@andrew-paterson
Copy link

I see the above error in the runtime status tab for the extension settings, and it seems that the language server is nt starting up.

No linting hints are showing up in my template files. I have confirmed that running npm run lint:hbs:fix from my project directory works.

I've also tried with only one Ember project in a workspace and the same issue occurred.

Ubuntu 22.04.2 LTS

Commit: 7f329fe6c66b0f86ae1574c2911b681ad5a45d63
Date: 2023-03-29T10:05:35.165Z
Electron: 19.1.11
Chromium: 102.0.5005.196
Node.js: 16.14.2
V8: 10.2.154.26-electron.0
OS: Linux x64 5.19.0-38-generic
Sandboxed: No```
@lifeart
Copy link
Owner

lifeart commented Apr 5, 2023

Hi @andrew-paterson! Thank you for report! Could you specify:

  • vscode version
    *extension version

Project details:

  • if any in-repo addons used
  • If any in-repo engines used
  • Ember version

Project structure:

  • is it monorepo?
  • Is there is more than one ember projects in repo?
  • root dir of ember app relative to repo root
  • yarn/npm/pnpm used
  • Is any linked package?

@andrew-paterson
Copy link
Author

My apologies some data was missing above.

vsCode version 1.77.0
UELS version v3.0.48

Project details

Ember version 3.28
ember-template-lint version 3.16.0
There are no in-repo addons or in-repo engines.

Project structure

There is only 1 ember project in the repo.
The ember app is at the root of the repo.
npm is used for package management, via Node version manager.
I've tried both with linked packages and without. Sometimes I also have nested linked packages.

@andrew-paterson andrew-paterson changed the title Uncught error - Connection got disposed Uncaught error - Connection got disposed Apr 5, 2023
@lifeart
Copy link
Owner

lifeart commented Apr 6, 2023

@andrew-paterson thank you for details!

Could you send output of this window:

image

@andrew-paterson
Copy link
Author

Hi @lifeart

Thank you!

Here it is. In case it helps, /home/paddy/test/monolith is the path to an Elixir project, not an Ember project.

"Initializing Ember Language Server at /home/paddy/test/monolith"
[Info  - 18:04:59] UELS: executeInitializers
To run Ember locally, please first run  export EMBER_SERVE=true
[Info  - 18:05:00] Ember CLI project added at /home/paddy/test/test-ember-assets
[Info  - 18:05:01] Connection to server got closed. Server will restart.
[Error - 18:05:01] Request workspace/executeCommand failed.
Error: Connection got disposed.
    at Object.dispose (/home/paddy/.vscode/extensions/lifeart.vscode-ember-unstable-3.0.48/dist/node/client/nodeClientMain.js:1:62879)
    at Object.dispose (/home/paddy/.vscode/extensions/lifeart.vscode-ember-unstable-3.0.48/dist/node/client/nodeClientMain.js:1:142962)
    at w.handleConnectionClosed (/home/paddy/.vscode/extensions/lifeart.vscode-ember-unstable-3.0.48/dist/node/client/nodeClientMain.js:1:143175)
    at w.handleConnectionClosed (/home/paddy/.vscode/extensions/lifeart.vscode-ember-unstable-3.0.48/dist/node/client/nodeClientMain.js:1:203521)
    at t (/home/paddy/.vscode/extensions/lifeart.vscode-ember-unstable-3.0.48/dist/node/client/nodeClientMain.js:1:141264)
    at r.invoke (/home/paddy/.vscode/extensions/lifeart.vscode-ember-unstable-3.0.48/dist/node/client/nodeClientMain.js:1:64492)
    at o.fire (/home/paddy/.vscode/extensions/lifeart.vscode-ember-unstable-3.0.48/dist/node/client/nodeClientMain.js:1:65253)
    at Y (/home/paddy/.vscode/extensions/lifeart.vscode-ember-unstable-3.0.48/dist/node/client/nodeClientMain.js:1:52137)
    at r.invoke (/home/paddy/.vscode/extensions/lifeart.vscode-ember-unstable-3.0.48/dist/node/client/nodeClientMain.js:1:64492)
    at o.fire (/home/paddy/.vscode/extensions/lifeart.vscode-ember-unstable-3.0.48/dist/node/client/nodeClientMain.js:1:65253)
    at d.fireClose (/home/paddy/.vscode/extensions/lifeart.vscode-ember-unstable-3.0.48/dist/node/client/nodeClientMain.js:1:73134)
    at ChildProcess.<anonymous> (/home/paddy/.vscode/extensions/lifeart.vscode-ember-unstable-3.0.48/dist/node/client/nodeClientMain.js:1:84095)
    at ChildProcess.emit (node:events:538:35)
    at maybeClose (node:internal/child_process:1092:16)
    at Socket.<anonymous> (node:internal/child_process:451:11)
    at Socket.emit (node:events:526:28)
    at Pipe.<anonymous> (node:net:687:12)
[Error - 18:05:01] Request workspace/executeCommand failed.
Error: Connection got disposed.
    at Object.dispose (/home/paddy/.vscode/extensions/lifeart.vscode-ember-unstable-3.0.48/dist/node/client/nodeClientMain.js:1:62879)
    at Object.dispose (/home/paddy/.vscode/extensions/lifeart.vscode-ember-unstable-3.0.48/dist/node/client/nodeClientMain.js:1:142962)
    at w.handleConnectionClosed (/home/paddy/.vscode/extensions/lifeart.vscode-ember-unstable-3.0.48/dist/node/client/nodeClientMain.js:1:143175)
    at w.handleConnectionClosed (/home/paddy/.vscode/extensions/lifeart.vscode-ember-unstable-3.0.48/dist/node/client/nodeClientMain.js:1:203521)
    at t (/home/paddy/.vscode/extensions/lifeart.vscode-ember-unstable-3.0.48/dist/node/client/nodeClientMain.js:1:141264)
    at r.invoke (/home/paddy/.vscode/extensions/lifeart.vscode-ember-unstable-3.0.48/dist/node/client/nodeClientMain.js:1:64492)
    at o.fire (/home/paddy/.vscode/extensions/lifeart.vscode-ember-unstable-3.0.48/dist/node/client/nodeClientMain.js:1:65253)
    at Y (/home/paddy/.vscode/extensions/lifeart.vscode-ember-unstable-3.0.48/dist/node/client/nodeClientMain.js:1:52137)
    at r.invoke (/home/paddy/.vscode/extensions/lifeart.vscode-ember-unstable-3.0.48/dist/node/client/nodeClientMain.js:1:64492)
    at o.fire (/home/paddy/.vscode/extensions/lifeart.vscode-ember-unstable-3.0.48/dist/node/client/nodeClientMain.js:1:65253)
    at d.fireClose (/home/paddy/.vscode/extensions/lifeart.vscode-ember-unstable-3.0.48/dist/node/client/nodeClientMain.js:1:73134)
    at ChildProcess.<anonymous> (/home/paddy/.vscode/extensions/lifeart.vscode-ember-unstable-3.0.48/dist/node/client/nodeClientMain.js:1:84095)
    at ChildProcess.emit (node:events:538:35)
    at maybeClose (node:internal/child_process:1092:16)
    at Socket.<anonymous> (node:internal/child_process:451:11)
    at Socket.emit (node:events:526:28)
    at Pipe.<anonymous> (node:net:687:12)
[Info  - 18:05:02] lazy init enabled, waiting for config from VSCode
"Initializing Ember Language Server at /home/paddy/test/monolith"

@lifeart
Copy link
Owner

lifeart commented Apr 7, 2023

It looks like server is going mad right after this line:

[Info  - 18:05:00] Ember CLI project added at /home/paddy/test/test-ember-assets

If we temporary remove this folder (/home/paddy/test/test-ember-assets) is all works fine?

@andrew-paterson
Copy link
Author

I've tracked down the issue via the output tab. One or two ember projects run process.exit and thus stop the ember server if a certain environment variable is not set, or if the post is not set to a specific number.

Is it possible to have the UELS run a command like export FOO=bar before it runs ember serve?

@lifeart
Copy link
Owner

lifeart commented Apr 11, 2023

@andrew-paterson, you mean inside ember-cli-build.js there is smf is exiting process?

There is few possible solutions:

  1. Ignore this ember project (in config)
  2. Create els addon and implement init hook (https:/lifeart/ember-language-server/blob/component-context-info-origin/src/project.ts#L208)
  3. Modify ember-cli-build.js to not fail

In scope of this conversation lifeart/ember-language-server#342
image
We agreed on environment name, specified by language server to be able to detect inside ember-cli-build is it executed by ls or ember-cli, if it may be a case - let me know, it's relatively simple to ship

@andrew-paterson
Copy link
Author

Thank you, that clarifies things.

I can definitely find a sane workaround based on those 3 options.

@lifeart
Copy link
Owner

lifeart commented Apr 14, 2023

@andrew-paterson let me know if I can help you somehow, also, if issue may be fixed if uELS introduce it's own env variable (EMBER_LANGUAGE_SERVER) - I could simply add it

@andrew-paterson
Copy link
Author

Would that allow me to set custom env vars inside that?
Another option would be if the settings could allow commands to be specified to run on the environment before ember serve.

@lifeart
Copy link
Owner

lifeart commented Apr 14, 2023

@andrew-paterson uELS does not run ‘ember serve’ command, it’s only loads config/environment.js file

@andrew-paterson
Copy link
Author

@lifeart, I found a good workaround to avoid the need for ENV vars before loading the environment file. It would be good to be able to set those though.

@lifeart
Copy link
Owner

lifeart commented May 31, 2023

@andrew-paterson in general, we need environment.js file only for podModulePrefix, and it seems easier to allow users specify it manually for projects, or allow to disable such discovery case. One more option - is just get value using AST parsing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants