-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
localIdentName
option moved in css-loader configuration
#2197
Comments
Webpacker only supports Line 30 in cc98e59
|
I faced same issue after upading css-loader but I solved it. If you check css-loader readme, then I noticed that "localIdentName" moved into modules key (it is possible that isn't a recent change, just my artifacts were old).
Old wrong config was:
Maybe you can check it also. |
For anyone not a webpack guru (and I'm not!), I found the code @gyurcigyurma 's code suggestion in my Rails app under /node_modules/@rails/webpacker/package/utils/get_style_rule.js. Thanks @gyurcigyurma ! |
Ah, you're totally right! We periodically upgrade all our dependencies, and when we tried to upgrade
It looks like when we actually run webpack, css-loader actually gets loaded by I'm not sure what the right fix for this is... maybe |
any workaround until webpacker gets a new version? |
|
In css-loader: 3.2, inside getStyleLoaders method, just replace |
…lIdentName configuration option but webpack requires cssloader so i modified the way the the webpackconfigjs file cites this using notes from github.com/rails/webpacker/issues/2197
I faced same issue, when I took a course on react. So it was before: Do it and it works: Hope I helped somebody. |
I think you don't need localIdentName,
this worked for me |
After ejecting, you need to make changes just on config/webpack.config.js file. The changed section should be look like below:
And now, good to go... |
Solved the problem, thanks man |
Thank you brother! |
No need to thanks bro 👍 |
It looks like all these things keep changing. |
Works for me as of this date, thanks!
That's a real problem but I guess the community is working on it. |
I am using |
You can get CSS modules working without having to eject by following the guide here: https://create-react-app.dev/docs/adding-a-css-modules-stylesheet/ Essentially, just rename |
Thank you so much ! It helped ; } |
God bless you man. It's fixed my compile problem |
In
css-loader
3.0.0, there was a breaking change with thelocalIdentName
configuration option:When we upgrade to css-loader >= 3.0, we see the following crashes when compiling:
I think the relevant webpacker source code is here
webpacker/package/utils/get_style_rule.js
Lines 17 to 26 in 41d79c9
The text was updated successfully, but these errors were encountered: