Next.js: options has an unknown property 'localIdentName'

Created on 4 Oct 2019  ·  15Comments  ·  Source: vercel/next.js

Bug report

Describe the bug

next.config.js

module.exports = withCSS(withSass({
  cssModules: true,
  cssLoaderOptions: {
    importLoaders: 1,
    localIdentName: "[local]___[hash:base64:5]",
  },
  webpack(config) {
    HACK_removeMinimizeOptionFromCssLoaders(config);
    config.module.rules.push({
      test: /\.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/,
      use: {
        loader: 'url-loader',
        options: {
          limit: 100000
        }
      }
    })
    // config.module.rules.push({
    //   test: /\.scss$/,
    //   use: [
    //   ]
    // })
    return config
  },
  sassLoaderOptions: {
    sourceMap: true
  }
}));

A clear and concise description of what the bug is.
스크린샷 2019-10-04 오후 4 06 05

if cssModule/cssLoaderOptions is removed, not problem..
why error plz?

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

System information

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

Additional context

Add any other context about the problem here.

upstream

Most helpful comment

I'm having the exact same issue while trying to update from next 9.2.1 to 9.3.1.''

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

  • options has an unknown property 'localIdentName'. These properties are valid:
  • object { url?, import?, modules?, sourceMap?, importLoaders?, localsConvention?, onlyLocals?, esModule? }

All 15 comments

This is fixed in [email protected]
Try updating next tothe latest canary build

i tried to install [email protected], but the same error occurred

i tried to install [email protected], but the same error occurred

Are you sure you are on "[email protected] ? "

If this doesnt work try this workaround suggested by @arunpdl for this same issue

Please try [email protected] instead.

Thank you for your answers.
but the same error occurred...

 "dependencies": {
    "@zeit/next-css": "^1.0.1",
    "@zeit/next-sass": "^1.0.1",
    "axios": "^0.19.0",
    "classnames": "^2.2.6",
    "next": "^9.0.8-canary.4",
    "node-sass": "^4.12.0",
    "prettier": "^1.18.2",
    "react": "^16.10.1",
    "react-dom": "^16.10.1",
    "sass-loader": "^8.0.0"
  },

스크린샷 2019-10-05 오전 10 19 39

@dijer119 please provide a fully reproducible project. Otherwise, we cannot fix this.

@Timer
i made sample project
please check it.
https://github.com/dijer119/next-style

@dijer119 you must remove HACK_removeMinimizeOptionFromCssLoaders... this code is causing it to break.

@Timer
If removed, the error below will occur.
Module not found: Can't resolve 'css-loader/locals' in '/Users/dijer/dev/workspace_sa/next-style'

@dijer119 fix up in https://github.com/zeit/next.js/pull/8970. Will release as [email protected] shortly.

@Timer
It's fixed. Thank you.

same issue @9.1.1

You may need 9.1.2-canary.1.

I'm having the exact same issue while trying to update from next 9.2.1 to 9.3.1.''

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

  • options has an unknown property 'localIdentName'. These properties are valid:
  • object { url?, import?, modules?, sourceMap?, importLoaders?, localsConvention?, onlyLocals?, esModule? }
Was this page helpful?
0 / 5 - 0 ratings