-
-
Notifications
You must be signed in to change notification settings - Fork 6.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
Reserved JS keywords are not allowed as CSS modules class names #14050
Comments
Start a new pull request in StackBlitz Codeflow. |
This is not supported because related: #11359 You can import the default import instead for a workaround. import style from './style.module.css'; |
I've implemented a fix via https://github.com/privatenumber/vite-css-modules (which is getting integrated into Vite core via #16018). Would you mind testing it out to see if it resolves your issue? EDIT: Confirmed working via privatenumber/vite-css-modules@9fdfa5b |
@privatenumber Tested and it works, thanks for the fix 💪 |
Describe the bug
When using CSS modules and importing to obtain computed class names, classes named using a JS reserved keywords are not available and return undefined.
There is no console warning or information in the documentation about that, and this test works on Webpack and Parcel.
As the following code is valid in JS, I don't think it should be a problem to support it:
Reproduction
https://stackblitz.com/edit/vitejs-vite-qmdhmt?file=main.js
Steps to reproduce
No response
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: