-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
CSS parsing error for media queries #8399
Comments
Again. It would be ideal if there was a way to say "Hey @parcel/transformer-css, don't try and process this file.". Because in some cases it causes more issues and prompts weird workarounds or me looking for a different tool entirely. |
I believe this actually is invalid. The whitespace after |
This example is lifted straight out of MDN and doesn't work with the transformer @media (not(hover)) { /* … */ } Could be an error in the documentation for which I can get fixed. Either way, it would be great if there was a way to escape files that might contain these things. As it brings everything to a halt. I'm importing external libs that contain code with this in and because I can't tell Parcel to not process the file getting imported, I have to use It's the same for new CSS features which aren't yet supported by Parcel. We are kinda held to the transformer's cadence which isn't ideal with the number of new features coming down the pipeline for CSS. I'm currently having to write my "new" CSS in JavaScript and inject it into the |
Yep, that's a bug in the MDN docs. That doesn't work in any browser. The way to work around this is the {
"@parcel/transformer-css": {
"errorRecovery": true
}
} In this case, that is the correct solution since the rule is invalid and would not apply in any browser. For other future CSS features such as unknown at rules and selectors, we can try to preserve them as is (within reason). For example, parcel-bundler/lightningcss@bbb64b7 does this for unknown functional pseudo classes such as shared element transitions. These will now warn rather than error until we implement them properly. I will try to do this for unknown at rules next, but this is harder. |
Awesome! 👍 Yeah, that A way of working around Thanks for this! 👏 🙏 |
Ahh, I tried that Importing an npm module style broke it @import 'npm:98.css'; using
With transformer version 2.6.2 yields the same error about |
errorRecovery was added in 2.7.0. |
Sweet. I'll make the update 👍 |
Going to close this one then. I think your other issue parcel-bundler/lightningcss#227 covers the remaining cases. |
🐛 bug report
This is valid CSS:
Yet, the Parcel CSS transformer throws an error about it.
@parcel/transformer-css: Unexpected token Function("not")
🎛 Configuration (.babelrc, package.json, cli command)
Default.
🤔 Expected Behavior
It compiles the CSS that is valid.
😯 Current Behavior
It fails on an error that isn't an error.
🔦 Context
It's another issue I've had where the CSS transformer has caused me an issue. In this case, I can't use an imported package because the transformer doesn't like it.
The text was updated successfully, but these errors were encountered: