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

Recurvise commentScanner stack overflow #715

Closed
martin-bailey opened this issue Dec 9, 2015 · 2 comments
Closed

Recurvise commentScanner stack overflow #715

martin-bailey opened this issue Dec 9, 2015 · 2 comments
Labels
Milestone

Comments

@martin-bailey
Copy link

I'm trying to clean Semantic-UI which is a huge CSS file. The recursive commentScanner seems to scan for too long and run out of stack space.

$ clean-css semantic.css

/usr/local/lib/node_modules/clean-css/lib/imports/inliner.js:130
comment = data.match(commentRegex);
^

RangeError: Maximum call stack size exceeded
at String.match (native)
at scanner (/usr/local/lib/node_modules/clean-css/lib/imports/inliner.js:130:20)
at scanner (/usr/local/lib/node_modules/clean-css/lib/imports/inliner.js:151:14)
at scanner (/usr/local/lib/node_modules/clean-css/lib/imports/inliner.js:151:14)
at scanner (/usr/local/lib/node_modules/clean-css/lib/imports/inliner.js:151:14)
at scanner (/usr/local/lib/node_modules/clean-css/lib/imports/inliner.js:151:14)
at scanner (/usr/local/lib/node_modules/clean-css/lib/imports/inliner.js:151:14)
at scanner (/usr/local/lib/node_modules/clean-css/lib/imports/inliner.js:151:14)
at scanner (/usr/local/lib/node_modules/clean-css/lib/imports/inliner.js:151:14)
at scanner (/usr/local/lib/node_modules/clean-css/lib/imports/inliner.js:151:14)

semantic.css.gz

@jakubpawlowicz
Copy link
Collaborator

I can see this problem indeed. Sorry about that, fix is coming.

@jakubpawlowicz jakubpawlowicz added this to the 3.4.9 milestone Dec 19, 2015
jakubpawlowicz added a commit that referenced this issue Jan 3, 2016
Using recursion was a short sighted idea.
jakubpawlowicz added a commit that referenced this issue Jan 3, 2016
Testing #715 revealed `mergeNonAdjacentByBody` spends lots of time
optimizing selectors with empty body, which, at the end, will be
removed.
jakubpawlowicz added a commit that referenced this issue Jan 3, 2016
Testing #715 revealed `mergeNonAdjacentByBody` spends lots of time
optimizing selectors with empty body, which, at the end, will be
removed.
@jakubpawlowicz
Copy link
Collaborator

It's fixed in 3.4.9.

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

No branches or pull requests

2 participants