Uncaught Error: Connection is closed.
[Enter steps to reproduce:]
- ...
- ...
Atom: 1.21.0 x64 Electron: 1.6.9 OS: "Fedora release Thrown From: ide-html package 0.3.0
Stack Trace
Uncaught Error: Connection is closed.
At /home/rvindenes/.atom/packages/ide-html/node_modules/vscode-jsonrpc/lib/main.js:606
Error: Connection is closed.
at /packages/ide-html/node_modules/vscode-jsonrpc/lib/main.js:131:28)
at throwIfClosedOrDisposed (/packages/ide-html/node_modules/vscode-jsonrpc/lib/main.js:606:19)
at Object.sendNotification (/packages/ide-html/node_modules/vscode-jsonrpc/lib/main.js:660:13)
at LanguageClientConnection._sendNotification (/packages/ide-html/node_modules/atom-languageclient/build/lib/languageclient.js:244:15)
at LanguageClientConnection.didChangeTextDocument (/packages/ide-html/node_modules/atom-languageclient/build/lib/languageclient.js:133:10)
at TextEditorSyncAdapter.sendFullChanges (/packages/ide-html/node_modules/atom-languageclient/build/lib/adapters/document-sync-adapter.js:183:22)
at Function.module.exports.Emitter.simpleDispatch (/usr/share/atom/resources/app/node_modules/event-kit/lib/emitter.js:25:20)
at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app/node_modules/event-kit/lib/emitter.js:141:34)
at /usr/share/atom/resources/app/src/text-editor.js:626:38
at Function.module.exports.Emitter.simpleDispatch (/usr/share/atom/resources/app/node_modules/text-buffer/node_modules/event-kit/lib/emitter.js:25:20)
at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app/node_modules/text-buffer/node_modules/event-kit/lib/emitter.js:141:34)
at DisplayLayer.emitDidChangeSyncEvent (/usr/share/atom/resources/app/node_modules/text-buffer/lib/display-layer.js:823:24)
at decorationLayerDisposable.textDecorationLayer.onDidInvalidateRange (/usr/share/atom/resources/app/node_modules/text-buffer/lib/display-layer.js:161:20)
at Function.module.exports.Emitter.simpleDispatch (/usr/share/atom/resources/app/node_modules/event-kit/lib/emitter.js:25:20)
at Emitter.module.exports.Emitter.emit (/usr/share/atom/resources/app/node_modules/event-kit/lib/emitter.js:141:34)
at TokenizedBuffer.module.exports.TokenizedBuffer.tokenizeNextChunk (/usr/share/atom/resources/app/src/tokenized-buffer.js:241:28)
at /usr/share/atom/resources/app/src/tokenized-buffer.js:206:32
at /usr/share/atom/resources/app/node_modules/underscore/underscore.js:666:53
Commands
-8:46.8.0 core:close (input.hidden-input)
Non-Core Packages
atom-beautify 0.30.5
atom-ide-ui 0.4.0
atom-ternjs 0.18.3
autocomplete-modules 1.7.2
busy-signal 1.4.3
editorconfig 2.2.2
file-icons 2.1.12
fonts 3.0.3
git-blame 1.3.1
git-time-machine 1.5.9
gl-light-syntax 3.0.0
ide-css 0.2.0
ide-html 0.3.0
ide-json 0.1.0
ide-typescript 0.6.1
intentions 1.1.5
language-babel 2.75.1
linter 2.2.0
linter-eslint 8.3.2
pigments 0.40.2
project-manager 3.3.5
project-sidebar 1.3.0
sync-settings 0.8.3
@ronnyvv does this stills happens after doing an app termination then start Atom again? If so, did you have opened file when Atom just started?
No, after restarting Atom I couldn't reproduce it with the same project. (I had a lot of files open (in tabs) for a long time when it did trigger)
@ronnyvv
- Perhaps you remember the last operation you did before the red --- Uncaught Error: Connection is closed. --- notification popped up?
- currently this package lacks connection exception handling mechanism. Will add feature for enhancement
It happened when closing a tab. I tried closing different tabs, including Close All Tabs from the menu and they all triggered the same exception.
Hey @liuderchi, I was able to clear out the ide-css cached code to prevent this same error happening with that package. Unfortunately, now it seems to be happening with ide-html. This error only seems to occur when I have a project open that has either css or html files included. I don't even necessarily have to have the files open in the editor just the project for this error to occur.
@ronnyvv sorry for the inconvenience.
Please try these steps to remove cached storage as temporarily workaround. Similar issues happen in ide-yaml, ide-css. We are trying to figure it out.
... prevent this same error happening with that package. Unfortunately, now it seems to be happening with ide-html.
@seanmhoffman IMO this issue is possibly related to package atom-language-client
which ide-html, ide-css, ide-yaml are ALL built upon.
Plus, there are similar issues for official ide packages also depending on atom-language-client:
- https://github.com/atom/ide-typescript/issues/17 (created earliest, maybe we can subscribe it)
- https://github.com/atom/ide-java/issues/29
- https://github.com/atom/ide-php/issues/60
- https://github.com/flowtype/ide-flowtype/issues/35
- https://github.com/kwerle/ide-ruby/issues/1
Other community ide-* packages
- https://github.com/liuderchi/ide-css/issues/8
- https://github.com/liuderchi/ide-yaml/issues/9
@liuderchi That seems pretty likely that atom-language-client might be the underlying cause. I've uninstalled all of the ide-* packages in the meantime until the issue is resolved.
I have some free time next week that should allow me to take a deeper look at what is happening. Anything I find or solutions I come across I'll let you know.
Yeah we're seeing this across all ide-x packages. I wish I knew what was causing it. If anyone finds a solid repro please @ me so I can get on it.
@damieng FYI: This similar issue from ide-ruby#1 is talking about one solid repro from language_server-ruby by early typing before all parsing is done.
Just started happening for me. Seems to be sleep/hibernate caused? idk
@NullVoxPopuli please try the following workaround
- dispatch command
Application: Open Your Config - add
debugLSP: trueunder core property then save - dispatch command
Window: Toggle Dev Toolsnavigate to console tag - close all opened files
- dispatch command
Window: reloadwait for a while - until no anymore log message from
ide-html, open one html file
I get this error even after uninstalling the ide-html package, with puppet files open. Very strange. The error pops up every time I type any key (add a space for instance). No idea how to make it stop or go away. It's constant and unending. :(
@davidnewhall If you are using macOS please try these steps to clear Atom cache