-
-
Notifications
You must be signed in to change notification settings - Fork 32
postcss-values-parser hangs indefinitely #112
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
Comments
Thanks for reporting. Are you able to downgrade to the previous version to see if it's a regression that was introduced? |
Yes, downgrading to v3.1.1 does not hang and gives the output I posted above. |
I'm experiencing the issue as well. postcss-values-parser v3.2.0 as a depency to postcss-custom-properties leads to infinite hangs as soon as a property is set by postcss-custom-properties to be used in postcss-inline-svg. For example this does not work with v3.2.0:
The same works with postcss-values-parser 3.1.1 when explicitly set to package.json:
|
Happy to review a PR that resolves this. |
Credit goes to @jonathantneal for identifying the offending code and cause.
@shellscape Thanks for the fix! |
How Do We Reproduce?
You can reproduce the issue with the following script:
How we got into this situation was that we had an undefined (bad) mixin that didn't get resolved and got passed to the values parser. Previously in version 3.1.1 the bad mixin was just ignored, now postcss-values-parser and by relation, webpack hangs indefinitely. We've fixed the bad mixin on our side but some other teams we work with have started seeing the issue. I don't think hanging indefinitely was intended even if this is unexpected css. At a minimum we should probably throw an error if this string is not ok.
Of note: this only breaks if there is a dash in the unresolved mixin.
Expected Behavior
The previous output of the function was:
Actual Behavior
The parser hangs indefinitely.
The text was updated successfully, but these errors were encountered: