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

Setting "selector-no-redundant-nesting-selector" to true causes FATAL error #266

Closed
stphane opened this issue Aug 9, 2018 · 14 comments
Closed

Comments

@stphane
Copy link

stphane commented Aug 9, 2018

Setting option scss/selector-no-redundant-nesting-selector: true in .stylelintrc.js causes:

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
==== JS stack trace =========================================

Security context: 0x3dc4aaf25879 <JSObject>
    1: tokenize(aka tokenize) [/home/workspace/project/node_modules/stylelint-scss/node_modules/postcss-selector-parser/dist/tokenize.js:~86] [pc=0x121715afd89b](this=0x31d4e50822d1 <undefined>,input=0x390ce8826d9 <Object map = 0x68c2f87b361>)
    2: new Parser [/home/workspace/project/node_modules/stylelint-scss/node_modules/postcss-selector-parser/dist/parser.js:159] ...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [node]
 2: 0x55fab5d742c2 [node]
 3: v8::Utils::ReportOOMFailure(char const*, bool) [node]
 4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [node]
 5: v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) [node]
 6: v8::internal::Runtime_AllocateInTargetSpace(int, v8::internal::Object**, v8::internal::Isolate*) [node]
 7: 0x1217159042fd

While running: webpack-dev-server --env.env dev --env.isLocal true --progress --inline --port=8080 --watch --hot

Using
└─┬ stylelint-scss@3.2.0
. └── postcss-selector-parser@4.0.0

@kristerkari
Copy link
Collaborator

Thanks!

This error has probably something to do with your setup rather than stylelint-scss. I would like to help, but it's quite impossible without some kind of demo where the error can be reproduced.

@stphane
Copy link
Author

stphane commented Aug 10, 2018

Thank you for your feedback, that's annoying actually, I could hardly imagine how my setup would interfer with this switch option which barely seems to check legitimate use of & ref during parse process.
This option used to work but now broke my build process since I have updated some dependencies, but sources have not changed.

@kristerkari
Copy link
Collaborator

@stphane If you upload your project somewhere where I can access it, I can have a look to see if I manage to reproduce the error.

@stphane
Copy link
Author

stphane commented Aug 10, 2018

Thank you for proposing but I cannot expose this project publicly :|

@kristerkari
Copy link
Collaborator

Alright. Just let me know if you find any reason why the error happens. For now I don't think that there is much that I can do to help. :)

@rtibbles
Copy link

I have come across this error too, but even with the setting in question turned off.
I think the error is actually coming from one of the dependencies, see here: postcss/postcss-selector-parser#139

It has been fixed in the 0.5.0 release candidate, but there is no final release just yet.

@rtibbles
Copy link

From my investigations I narrowed it down to this rule: 'scss/percent-placeholder-pattern' rather than the one reported above, with the following setting "^[a-z]+([a-z0-9-]+[a-z0-9]+)?$" in stylelint-config-sass-guidelines package.

@kristerkari
Copy link
Collaborator

@rtibbles Thanks a lot for investigating why the error happens. I'll try to see if I manage reproduce the error on my machine.

@rtibbles
Copy link

One other useful thing to note, is that I only triggered this when linting somewhere on the order of 200+ files (and maintaining reference to each file by wrapping all calls to stylelint in a Promise.all).

@kristerkari
Copy link
Collaborator

I think that when postcss-selector-parser v5.0.0 gets released, we can upgrade to it and see if that fixes this issue.

@bjankord
Copy link
Contributor

bjankord commented Dec 5, 2018

@rtibbles, you might try making a branch/fork of this repo and update postcss-selector-parser to pull in the latest release candidate of postcss-selector-parser, v5.0.0-rc.4, and see if that resolves the issue. I haven't been able to reproduce the noted memory issue.

@rtibbles
Copy link

rtibbles commented Dec 6, 2018

I just stopped using the rule I identified above, and that stopped me getting the memory issues, so I am not in an urgent rush to fix this!

@bjankord
Copy link
Contributor

bjankord commented Dec 6, 2018

Ok, that is understandable. I don't have a reproducible test case, so likewise, I am not in an urgent rush to fix this.

@kristerkari
Copy link
Collaborator

This should now be fixed in v3.4.4. If it's not fixed yet, let's re-open this issue.

https://github.com/kristerkari/stylelint-scss/releases/tag/3.4.4

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

No branches or pull requests

4 participants