question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

localIdent cause an error during build with css-modules

See original GitHub issue

https://github.com/arackaf/customize-cra/blob/404854bcbe7436f5834e4c4863001610951d5c3c/src/customizers/webpack.js#L177-L197

I followed this article to setup a create react app project with less loader and css modules. And once you try to actually import a less file, for exemple:

import styles from "./App.module.less";

it causes the following error during build (with yarn start):


s-loader/src??postcss!./node_modules/less-loader/dist/cjs.js??ref--6-oneOf-8-3!./src/App.module.less
)
ValidationError: Invalid options object. CSS Loader has been initialized using an options object tha
t does not match the API schema.
 - options has an unknown property 'localIdentName'. These properties are valid:
   object { url?, import?, modules?, sourceMap?, importLoaders?, localsConvention?, onlyLocals?, esM
odule? }

is there a way to override the settings causing this without actually changing the lib ?

Edit: I tested removing localIdentName and it works. Although I’m sure it’s there for some reason.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:9
  • Comments:13

github_iconTop GitHub Comments

1reaction
Drikycommented, Jun 2, 2020

@Anish-Agnihotri if it’s alright with you I will close the issue ?

1reaction
Drikycommented, May 28, 2020

Alright I will test that tomorrow (actually later today, it’s 3am here).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error while configuring CSS modules with webpack
Syntax of css-loader options has changed in version 3.0.0. localIdentName was moved under modules option.
Read more >
options has an unknown property 'localidentname'. these ...
v2.2.2 --> h5 编译 开启 cssModules 报 options has an unknown property 'localIdentName' ... it causes the following error during build (with yarn...
Read more >
CSS Modules and React
In this final post of our series on CSS Modules, I'll be taking a look at how to make a static React site...
Read more >
css-loader | webpack - JS.ORG
Allows auto enable CSS modules/ICSS based on filename when modules option is object. Possible values: undefined - enable CSS modules for all files....
Read more >
babel-plugin-react-css-modules - Bountysource
I use the plugin postcss-scss together with sass-loader in Webpack 4. It works if the css class names are global and i use...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found