Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Huge amount of comments causes RangeError: Maximum call stack size exceeded #993

Closed
Suunto-PekkaV opened this issue Feb 29, 2016 · 5 comments

Comments

@Suunto-PekkaV
Copy link

A 10 000 line comment at http://lisperator.net/uglifyjs/#demo causes RangeError: Maximum call stack size exceeded -error.

Attached is the input that should reproduce this error. The file has simply // Your code goes here -line 10 000 times.
huge-amount-of-comments-rangeerror-example-input.js.txt

@rvanvelzen
Copy link
Collaborator

For my sanity: did you encounter this in a real-world scenario?

This is caused by recursive calls from next_tokenhandle_slashskip_line_commentnext_token.

@Suunto-PekkaV
Copy link
Author

It happened in a real world case where large chunk of json data was commented out.

@rvanvelzen
Copy link
Collaborator

If you're running it manually, you can work around by doing something like node --stack-size=100000 bin/uglify your-file-here.js.

Fixing this completely requires rewriting chunks of the parser, which may take some time.

@alexlrobertson
Copy link

I'm also encountering this error with a file that is 135,594 lines long (a nasty, huge bundle of our 3rd party dependencies).

@kzc
Copy link
Contributor

kzc commented Apr 16, 2016

See PR #1045

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants