leinelissen / laravel-mix-react-css-modules

A wrapper for babel-plugin-react-css-modules for Laravel Mix
MIT License
22 stars 9 forks source link

Not working with laravel 7.X #11

Closed hanakivan closed 4 years ago

hanakivan commented 4 years ago

When using this with laravel 7.X, you get the following error:

But it's just webpack's issue. Here's a solution: https://stackoverflow.com/a/57903310/2880184

You dan really fix it yourself:

  1. go to node_modules/laravel-mix-react-css-modules
  2. find localIdentName
  3. and replace the var options with var options = { modules: { localIdentName: this$1.scopedName }, importLoaders: 1 };

`Module build failed (from ./node_modules/css-loader/dist/cjs.js): ValidationError: Invalid options object. CSS Loader has been initialized using an options object that does not match the API schema.

leinelissen commented 4 years ago

I'll release a new version that covers Laravel 7 shortly

leinelissen commented 4 years ago

By the way, this issue should only affect users who are on the Laravel Mix v6 Alpha, as v5 still uses an old version of css-loader. I will release a beta for this purpose shortly.

leinelissen commented 4 years ago

This problem should be fixed with the v3 that was just released to alpha for this package. It will be released as a regular version when Laravel Mix 6 hits the streets. Install using the following command:

npm install laravel-mix-react-css-modules@next