-
-
Notifications
You must be signed in to change notification settings - Fork 75
preset-env 8.2.0 or later let's Nuxt 3 dev server hang #948
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
@t0byman There isn't much we can see in that repro. |
@romainmenke You don't have to process any css for it to hang. Something changed from 8.1.0 to 8.2.0 which hangs the dev server even without processing any css, only adding it to the postcss.config.js makes this happen. |
Unfortunately I don't know anything about nuxt, so you will have to provide a lot more info than this. How did you verify that it isn't processing any CSS and that it hangs just by loading? |
This for examples seems to work fine :
So somewhere there is CSS being processed and somehow it is causing an infinite loop. |
I see, stage 4 and 3 work, but stage 2, 1 and 0 don't. Yeah ok, I'll dive a bit deeper then. |
Is it correct that Normally I debug things like this by creating a "debug" postcss plugin that just logs things. But this plugin is never published, it's just a closure in the config file. |
Yes, this is correct. I am not sure about nuxt v2, but in v3, the config has a
I think your approach could still work. But you'd have to wrap it in a separate module and implement it locally using |
I wish frameworks wouldn't do this. I think I tracked down what is going on.
The parser algorithm for interpolation methods and color space interpolation scans until it finds a comma node. We didn't account for the possibility of gradient notations without any commas. We have added extra checks to make sure we try to parse less, making issues in older/existing syntax less likely and we fixed the infinite loop. We will release this asap. Thank you for reporting this @t0byman |
I have to agree. Thanks for getting on this so quickly @romainmenke, you're a life saver! |
@t0byman @SuperSchek This has been released, thank you again for reporting and for providing extra info 🎉 |
Reproduction link
https://stackblitz.com/edit/nuxt-starter-3paghm?file=package.json
Bug description
When adding
"postcss-preset-env": "^8.3.1"
to package.json andto postcss.config.js, the nuxt 3 dev server wil hang.
Actual Behavior
The nuxt dev server will hang at
✔ Nitro built in 199 ms
, you'll never seeℹ Vite client warmed up in 1177ms
Expected Behavior
For v8.3.1 to not let the Nuxt dev server hang. v8.1.0 works but v8.2.0 is where the problem starts.
Can you reproduce it with
npx @csstools/csstools-cli <plugin-name> minimal-example.css
?No
npx
OutputNo response
Extra config
No response
What plugin are you experiencing this issue on?
PostCSS Preset Env
Plugin version
8.3.1
What OS are you experiencing this on?
macOS
Node Version
v16.14.2
Validations
Would you like to open a PR for this bug?
The text was updated successfully, but these errors were encountered: