laravel-mix: Unexpectedly fails with postcss-loader v4.0.0
Error I’m seeing with postcss-loader v4.0.0:
ERROR in ./assets/scss/style.scss
Module build failed (from ./node_modules/css-loader/dist/cjs.js):
ModuleBuildError: Module build failed (from ./node_modules/postcss-loader/dist/cjs.js):
ValidationError: Invalid options object. PostCSS Loader has been initialized using an options object that does not match the API schema.
- options has an unknown property 'plugins'. These properties are valid:
object { postcssOptions?, execute?, sourceMap? }
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 36
- Comments: 25
Commits related to this issue
- Add postcss-loader v3 Specify the version due to: ValidationError: Invalid options object. PostCSS Loader has been initialized using an options object that does not match the API schema. See: https... — committed to jibees/openfoodnetwork by jibees 3 years ago
- Add postcss-loader v3 Specify the version due to: ValidationError: Invalid options object. PostCSS Loader has been initialized using an options object that does not match the API schema. See: https... — committed to jibees/openfoodnetwork by jibees 3 years ago
- Add postcss-loader v3 Specify the version due to: ValidationError: Invalid options object. PostCSS Loader has been initialized using an options object that does not match the API schema. See: https... — committed to jibees/openfoodnetwork by jibees 3 years ago
- Add postcss-loader v3 Specify the version due to: ValidationError: Invalid options object. PostCSS Loader has been initialized using an options object that does not match the API schema. See: https... — committed to jibees/openfoodnetwork by jibees 3 years ago
- Add postcss-loader v3 Specify the version due to: ValidationError: Invalid options object. PostCSS Loader has been initialized using an options object that does not match the API schema. See: https... — committed to jibees/openfoodnetwork by jibees 3 years ago
- Add postcss-loader v3 Specify the version due to: ValidationError: Invalid options object. PostCSS Loader has been initialized using an options object that does not match the API schema. See: https... — committed to jibees/openfoodnetwork by jibees 3 years ago
- Add postcss-loader v3 Specify the version due to: ValidationError: Invalid options object. PostCSS Loader has been initialized using an options object that does not match the API schema. See: https... — committed to jibees/openfoodnetwork by jibees 3 years ago
I have the same problem here. Downgraded to postcss-loader v3 to work (not ideal, but does the job for now):
I don’t use laravel-mix, but this is one of the few places I saw this error talked about, so adding comments on how I resolved it.
postcss-loader 4 seems to require postcss 8.x, but when I did the upgrade from 3 to 4, postcss was not upgraded automatically. Explicitly upgrading to postcss 8 and making the necessary changes to the postcss.config.js format (specifically
plugins: {}topostcssOptions: { plugins: [] }) fixed this problem up for me.Hope that helps somebody.
This is fixed in the upcoming release.
… did they remove stat presets? I’ll take a look this weekend. 😐
When I tried using
tailwind v2.0withlaravel-mix 6.0.0-beta.14andpostcss ^8.1.7withpostcss-loader ^4.1.0with updatedpostcss.config.js, but this time I’m getting:Has the fix already been added to beta version?
I’m getting the same errors using
npx mixI had to manually npm install version 5 of webpack.
These errors are bcause laravel-mix’s default webpack config is incompatible with Webpack 4 which I had previously