-
-
Notifications
You must be signed in to change notification settings - Fork 609
[2.0.0] ValidationError: CSS Loader Invalid Options - options should NOT have additional properties #863
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
Comments
no issue in 1.0.1 |
I have the same issue, I can confirm that in version 1.0.1 it works well |
I have the same issue too.
|
hm, looks you have plugin what add more options to |
@evilebottnawi thank you! That is to say , [email protected] add verification of illegal parameters
|
Same issue here
And works fine if remove |
https://github.com/wanliyunyan/dva-typescript-antd-starter-kit ,this is my config , webpack.base.js is in the build folder. Please advise! |
@fpsqdb please don't write |
for me it i still have this error when i do not even use minimize. |
@p3x-robot |
@evilebottnawi that's what i am saying, i do not even use this option and it error happens with production webpack flag or webpack-dev-server. |
@p3x-robot need repo, looks other loader or plugin add option |
other guys have already provided repro, isnt it enough? |
i am fine with 1.0.1, as long as it works. |
@p3x-robot you can have other problemы and if you want so solve issue quickly will be great to see you minimum reproducible test repo |
git clone https://github.com/patrikx3/gitlist
# change package.json css-loader from 1.0.1 to 2.0.0
npm install
npm run build than you get this error. with v1.0.1, no error. |
@p3x-robot thanks, will be fixed today and released |
thank you very much |
@wanliyunyan can't reproduce, in future please add instruction how i can reproduce problem, you project is not small and i just losing time trying to reproduce. P.S. use |
@p3x-robot reproduced, WIP |
@p3x-robot remove this line https://github.com/patrikx3/gitlist/blob/master/webpack.config.js#L211 (minimize will be removed in |
Solved. Feel free to feedback. |
it works ! works in my all 4 repos. thanks so much!!!!!!!!!!!!!!!!!!!!!!!! |
Can confirm that removing |
my only problem is, that now the css is not uglified: @evilebottnawi |
@p3x-robot use https://github.com/NMFR/optimize-css-assets-webpack-plugin for css minimication, |
got it, thanks! |
@BerekHalfhand please provide minimum reproducible test repo, |
All who have problems please provide minimum reproducible test repo and we fix it |
@BerekHalfhand minimize has been removed, just take a look at this issue: webpack-contrib/extract-text-webpack-plugin#434 |
Unfortunately, I had to downgrade to 1.0.1 from 2.1.1 because this issue is still impacting my builds. |
as it does not work in current version and causes error. Ref: webpack-contrib/css-loader#863
|
Coming across this issue again on 3.0.0 For me, it was
|
Had the same issue, but it is indeed explained in the breaking changes section of the v3 changelog:
Which did solve it for me. |
There is not shit like 'minimize:true' in my config. |
I am facing the same issue with version 3.0.0 |
To those needing help, just change the key <-> pair like what @eric-miffre mentioned. Here's an example: Before: After: Notice how now you have a modules Object within the options Object. Just put all your previous key <-> value pairs within the modules Object and you'll be good to go |
Confirmed working. In my case I changed it from
to
in my webpack/babel config. |
@truonghoangphuc how do you achieve that for production when build automatically installs the css-loader package for next-js ? manipulate the file during build time or is there a way to do it using next.config.js ? For now, I downgraded : |
It suddenly happens in one of my projects too, after I updated all dependencies to their most recent version. Looks like it doesn't have to do anything with the other dependencies being upgraded, because I created a minimal reproducible example and it happens there too: webpack.config.js module.exports = {
entry: './index.js',
mode: 'production',
module: {
rules: [{
test: /module.css$/,
use: [{
loader: require.resolve('css-loader'),
options: {
localsConvention: 'camelCase',
modules: true,
getLocalIdent: () => {
return Math.random().toString(36).substring(2)
},
},
}]
}],
},
} package.json dependencies: "devDependencies": {
"css-loader": "^2.1.1",
"webpack": "^4.35.3",
"webpack-cli": "^3.3.5"
} index.js: const css = require('./test.module.css');
console.log(css); test.module.css .html {} And the build error I get is:
Any idea what's wrong here?! |
|
Strongly recommend don't use random |
In work, in near future we release new version with better errors |
It was just for demonstration 😉 I use |
Still doesn't work btw. Now I'm getting:
I pushed it into a temporary repo. I don't see what's wrong here?! |
Ok, looks like I was mixing 3.0.0 options with 2.1.1. Upgraded to 3.0.0 and it seems to work. Thanks for the ultra fast help! |
{
test: /\.css$/,
use: [
MiniCssExtractPlugin.loader,
{
loader: 'css-loader',
options: {
modules: {
localIdentName: "[path][name]__[local]--[hash:base64:5]"
}
}
}
]
} |
I don't know why, but it's okay to upgrade to the latest 3.2.0. |
This worked for my VUE Js project: Browse to the
|
Expected Behavior
I can use the css-loader, I have not changed anything.
Actual Behavior
Code
How Do We Reproduce?
It happens with css-loader 2.0.0
The text was updated successfully, but these errors were encountered: