Next.js: ValidationError: Invalid options object. CSS Loader has been initialised using an options object that does not match the API schema

Created on 30 Sep 2019  路  11Comments  路  Source: vercel/next.js

Bug report

Describe the bug

When upgrade to v9.0.7. css-loader throw an API schema error. It won't happens in v9.0.6. Seems minimize has been removed from the options of css-loader (see here)

To Reproduce

  1. yarn upgrade next.js@^9.0.7
  2. yarn dev

Expected behavior

app compiled success

Screenshots

铻㈠箷蹇収 2019-09-30 涓嬪崍1 40 57

System information

  • OS: macOS
  • Browser: chrome
  • Version of Next.js: 9.0.7

Most helpful comment

@timneutkens be aware that because next 9.0.7 now forces css-loader 3.2.0, anyone that uses @zeit/next-css will run into that issue. So i think it should be top priority. I would also like to see a migration path from css-loader to the new experimental css feature.

All 11 comments

Duplicate of https://github.com/zeit/next-plugins/issues/541

Will keep it open there as this doesn't relate to Next.js internals.

@timneutkens be aware that because next 9.0.7 now forces css-loader 3.2.0, anyone that uses @zeit/next-css will run into that issue. So i think it should be top priority. I would also like to see a migration path from css-loader to the new experimental css feature.

+1, happening with @next/less for me.

Please try [email protected] -- this version should fix these broken plugins.

I got this error using 9.0.7 and @zeit/next-sass, 1.0.1 when I upgrade to [email protected] I get Module not found: Can't resolve 'css-loader/locals'

@retallicka please provide a reproduction.

@retallicka a fix should be up in https://github.com/zeit/next.js/pull/8957; I found the source of this loader.

Please give v9.0.8-canary.4 a try.

I confirm for 'next-sass'
"@zeit/next-sass": "^1.0.1"
produced the same error with [email protected],
but works with [email protected]

Was this page helpful?
0 / 5 - 0 ratings