-
-
Notifications
You must be signed in to change notification settings - Fork 606
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
Cannot load CSS module file which has a class named "default" after 7.x upgrade #1589
Comments
You can't use |
Fix - #1590, I improved logic and now we rename |
Anyway I added test case with:
And can't reproduce the problem, maybe you forget to apply these options in another place Anyway feel free to feedback (or provide reproducible test repo) |
@alexander-akait Thanks for making that change. Can you help me understand why this change was made in v7? Since a CSS Modules file is returned as an object I don't understand how a class called I would understand if the class name was something like |
You should not have problems with |
Ah, you're right. My bad. I saw the docs still said |
Bug report
After upgrading from 6.x to 7.x, some of my CSS modules files are failing to get processed. My webpack module rule is defined as:
Actual Behavior
If my CSS modules file has
.default {}
CSS class defined, webpack fails to generate the build with this error:Expected Behavior
Ideally the same behaviour as 6.x where I can have my CSS classes defined with any name.
How Do We Reproduce?
Add the module rule configuration pasted above to your webpack config. Then create and import the following CSS file:
Via some JavaScript asset:
Run the webpack build via:
webpack --config ./webpack.config.js
.Please paste the results of
npx webpack-cli info
here, and mention other relevant informationThe text was updated successfully, but these errors were encountered: