Joezo / atom-jshint

Validate your JS against JSHint as you type, while using Atom
MIT License
39 stars 15 forks source link

Uncaught Error: Channel Closed when typing strict equality operator #18

Open sodper opened 10 years ago

sodper commented 10 years ago

I'm getting the error channel closed while while typing. It occurs predictably right after typing the strict equality operator in an if-statement, e.g. if (thing ===|). The error occurs on line 99 of /Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/history.js.

I'm running v0.69.9 of Atom and v1.1.0 of atom-jshint on OS X 10.9.1.

Joezo commented 10 years ago

I can't seem to reproduce this myself. Does anyone else experience this problem? I'm running v0.69.0 of Atom, i'm guessing the .9 you stated was a typo as I can't see that version myself. Also, the error you posted; it looks like it's part of the core node_modules within text-buffer. You could try posting the issue you are getting over there? They might be able to help a bit further :) https://github.com/atom/text-buffer

sodper commented 10 years ago

Yeah, you're right - it should be 0.69.0. The problem disappears when disabling atom-jshint and turns up again when I enable it.

Joezo commented 10 years ago

Okay that sounds like it's definitely something wrong with this package then! Lets try and reproduce it! Are you able to provide a test file that this occurs in? It may be that it's something rather specific that's causing the problem.

sodper commented 10 years ago

Well, I couldn't seem to recreate the problem with a new file. However, when opening a previous project it showed up again. The project in question is available at https://github.com/sodper/yatzy-kata. I can reproduce the bug when cd:ing into the main directory via terminal and issuing the atom command. Then I just open lib/yatzy.js and in one of the functions create an if-statement with strict equality. I had to try a few times in order reproduce it the last time.

sodper commented 10 years ago

Here's the call stack when the error occurs:

target.send                        child_process.js:408
module.exports.AtomJsHint.run      /Users/Per/.atom/packages/atom-jshint/lib/atom-jshint.js:82
(anonymous function)               /Users/Per/.atom/packages/atom-jshint/lib/atom-jshint.js:42
module.exports.History.transact    /Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/history.js:90
module.exports.TextBuffer.transact /Applications/Atom.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:900
(anonymous function)               /Users/Per/.atom/packages/atom-jshint/lib/atom-jshint.js:41
later                              /Users/Per/.atom/packages/atom-jshint/node_modules/underscore-plus/node_modules/underscore/undersco…:705
Joezo commented 10 years ago

Okay, I still can't reproduce this. I did find some left over code in the package that could be causing that. I've now removed it and released it as v1.1.1, see if it still occurs!

Ah. Just seen your callstack, it could well be the code i've removed. Although it does look like the child process is dying off... hmm. Can you let me know if this release fixes it please.

sodper commented 10 years ago

No, sorry. I still get the same problem.

Joezo commented 10 years ago

Hmm, have you reloaded atom since updating the package `ctrl+alt+cmd+L'? (just to be sure)

If not, are you able to provide an up to date callstack please? :)

sodper commented 10 years ago

Ok, reloaded Atom and reproduced the bug. Now I got:

Uncaught Error: channel closed      events.js:82
sodper commented 10 years ago

Typing more gives me:

Uncaught Error: channel closed   child_process.js:408
target.send                      child_process.js:408
module.exports.AtomJsHint.run    /Users/Per/.atom/packages/atom-jshint/lib/atom-jshint.js:80
(anonymous function)             /Users/Per/.atom/packages/atom-jshint/lib/atom-jshint.js:41
later                            /Users/Per/.atom/packages/atom-jshint/node_modules/underscore-plus/node_modules/underscore/undersco…:705
Joezo commented 10 years ago

Okay, this could take some time to debug. Thanks for the info, i'm going to look into it further tomorrow as it's time to switch off for the evening. In the mean time, if you have the time, don't be shy of digging through the package and throwing some debugging in, see if you can nail where the process is being killed.

Sorry about this :(

brycebaril commented 10 years ago

I'm also getting this same issue.

ghost commented 10 years ago

@brycebaril Updating atom resolved for me last week.

brycebaril commented 10 years ago

@jamesedwardcooke I'm fully up-to-date :/

brycebaril commented 10 years ago

Still getting this with atom 0.89.0

It happens as soon as I press space after typing either == or === in an if conditional.

Here is my jshint config:

  "jshintConfig": {
    "asi": true,
    "globalstrict": true,
    "eqnull": true,
    "node": true,
    "eqeqeq": false
  }
Joezo commented 10 years ago

Okay i've actually managed to replicate it, i'm guessing something in atom has changed because i've only managed to replicate it since my editor updated. Will look into this one!

nrako commented 10 years ago

I'm still struggling with this issue. It appears that the "JSHINT_Worker" Atom Helper process crash if jshint config is set to "eqnull": true on codes as mentioned above, and the only way to get it back is to restart atom.

Does anyone know why jshint crash on that, is this a known issue?... on jshint side?

Anyway, in the meantime I wonder if a JSHINT_Worker.on('close', function () {/* restart the damn thing */}); could at least make that kind of issue less annoying?

Oh and also when the closed channel crash happens, if I try to disable the plugin I get a nice SyntaxError: Unexpected end of input which this time crash Atom :anger:

Joezo commented 10 years ago

Oh, nice one for nailing where that comes from. Go ahead and put anything in which you think will resolve the issue, i'm not able to replicate at my end any more :(

nrako commented 10 years ago

Added to my reminders, I'll try something asap.

wcandillon commented 9 years ago

I am also experiencing this issue with my atom setup up to date.