liuderchi / ide-html

:atom: Atom-IDE for HTML, Go Template, Mustache and other Templates
https://atom.io/packages/ide-html
MIT License
20 stars 5 forks source link

Uncaught Error: Connection is closed. #9

Open ronnyvv opened 6 years ago

ronnyvv commented 6 years ago

[Enter steps to reproduce:]

  1. ...
  2. ...

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 
liuderchi commented 6 years ago

@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?

ronnyvv commented 6 years ago

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)

liuderchi commented 6 years ago

@ronnyvv

  1. Perhaps you remember the last operation you did before the red --- Uncaught Error: Connection is closed. --- notification popped up?
  2. currently this package lacks connection exception handling mechanism. Will add feature for enhancement
ronnyvv commented 6 years ago

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.

seanmhoffman commented 6 years ago

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.

liuderchi commented 6 years ago

@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.

liuderchi commented 6 years ago

... 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:

Other community ide-* packages

seanmhoffman commented 6 years ago

@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.

damieng commented 6 years ago

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.

liuderchi commented 6 years ago

@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.

NullVoxPopuli commented 6 years ago

Just started happening for me. Seems to be sleep/hibernate caused? idk

liuderchi commented 6 years ago

@NullVoxPopuli please try the following workaround

  1. dispatch command Application: Open Your Config
  2. add debugLSP: true under core property then save
  3. dispatch command Window: Toggle Dev Tools navigate to console tag
  4. close all opened files
  5. dispatch command Window: reload wait for a while
  6. until no anymore log message from ide-html, open one html file
davidnewhall commented 5 years ago

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. :(

liuderchi commented 5 years ago

@davidnewhall If you are using macOS please try these steps to clear Atom cache