Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit. #889

Closed
adamjimenez opened this Issue · 13 comments

5 participants

@adamjimenez

I get this error in chrome if I press the lint button 3x.
http://www.jshint.com/

@apepper

I also get this warning, when checking a bigger js file.

Can you provide a way (e.g. a directive) to increase the limit per file and/or global?

@valueof
Owner

Uhm, I just need to fix that.

@apepper

It seems, that this behavior makes Internet Explorer stop working with JSHint. I tested this with IE9 and IE10.

Test with IE

Run the following three times in the console of IE:

var source_code = "//";
var options = {};
console.log(JSHINT(source_code, options));
@apepper apepper referenced this issue in infopark/screw_server
Merged

Jshint #4

@ljharb

This is the output I get when I run it through a custom command line tool:

(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
    at EventEmitter.addListener (events:110:17)
    at Object.api.on (/src/stable/jshint.js:3348:14)
    at Array.forEach (native)
    at Object.api.on (/src/stable/jshint.js:3347:22)
    at exports.register (/src/stable/style.js:70:9)
    at state.tokens.prev.state.tokens.curr.state.tokens.next (/src/stable/jshint.js:3355:4)
    at Array.forEach (native)
    at Context.itself (/src/stable/jshint.js:3354:24)
    at /path/to/runner:218:32
    at Array.forEach (native)

Any ETA on a fix? I suspect fixing this will make JSHint run much faster for me as well.

@MiguelCastillo

Hi, I am having the same issue. I am happy to ignore the error if we know that jshint still generates stable and reliable results. Otherwise, any suggestions on getting around this issue even if we it means that I have to use an older version of jshint?

@apepper

@MiguelCastillo I'm using the older version 0.9.1, since that seems to be more stable and doesn't have this bug. Be aware, that the options in version 0.9.x are in some cases different than version 1.0.0. Archive.org to the rescue: http://web.archive.org/web/20130115160534/http://jshint.com/docs/

@MiguelCastillo

@apepper I have found too that using an older version does not have this issue. I am currently making use of shared/message.js as it is what the newer version of jshint uses for reporting, so I guess I am gonna have to rig together the old version and load message.js... PITA

Thank you for your feedback

@MiguelCastillo

I have taken messages.js and I am successfully using with an older version of jshint. The newer jshint really seems more buggy (regressions)... I am sticking to the older version until things are really more stable.

@valueof valueof closed this issue from a commit
@valueof valueof Upgrade Browserify to 2.12.0
This should improve performance on Rhino and resolve EventEmitter
leaks.

Closes GH-983.
Closes GH-958.
Closes GH-931.
Closes GH-889.
Affects GH-987.
f2843c5
@valueof valueof closed this in f2843c5
@MiguelCastillo

This upgrade fixed the issue. Thanks!!!

@ljharb

I've ran node make.js and the file that ends up in dist seems unchanged. Does something else need to be updated?

@valueof
Owner

Yeah, you need to run node make.js build now. node make.js lints and runs tests only.

@ljharb

Thanks! Perhaps an update to package.json's scripts.build, so npm build would make the build? I'll make a PR.

@valueof
Owner
@jugglinmike jugglinmike referenced this issue from a commit in jugglinmike/jshint
@valueof valueof Upgrade Browserify to 2.12.0
This should improve performance on Rhino and resolve EventEmitter
leaks.

Closes GH-983.
Closes GH-958.
Closes GH-931.
Closes GH-889.
Affects GH-987.
d54e023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.