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

Already on GitHub? Sign in to your account

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

Closed
adamjimenez opened this Issue Mar 4, 2013 · 13 comments

Comments

Projects
None yet
5 participants

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

apepper commented Mar 6, 2013

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?

Owner

valueof commented Mar 6, 2013

Uhm, I just need to fix that.

apepper commented Mar 7, 2013

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 Mar 7, 2013

Merged

Jshint #4

Contributor

ljharb commented Mar 19, 2013

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.

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 commented Apr 8, 2013

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

@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

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 in f2843c5 Apr 8, 2013

This upgrade fixed the issue. Thanks!!!

Contributor

ljharb commented Apr 9, 2013

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

Owner

valueof commented Apr 9, 2013

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

Contributor

ljharb commented Apr 9, 2013

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

Owner

valueof commented Apr 9, 2013

Sounds good.

On 8 April 2013 18:22, Jordan Harband notifications@github.com wrote:

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


Reply to this email directly or view it on GitHubhttps://github.com/jshint/jshint/issues/889#issuecomment-16089054
.

apepper added a commit to apepper/screw_server that referenced this issue Mar 10, 2014

jugglinmike added a commit to jugglinmike/jshint that referenced this issue Oct 21, 2014

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment