4

webpack.config.js

 {
    test: /\.scss$/,
    use: [
      "style-loader",
      {
        loader: "typings-for-css-modules-loader",
        options: {modules: true,nameExport: true,camcelCase: true,sass: true}
      },
      "sass-loader"
    ]
  }

when I run 'npm run dev',error happend. And when I modify the index.scss file,no declare file like 'index.scss.d.ts' to created.

Uncaught Error: Module build failed (from ./node_modules/typings-for-css-modules-loader/lib/index.js):

Error: Cannot find module 'css-loader/locals' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15)

Can you tell me how to fix it? thank you!

2 Answers 2

3

Now I fix it.Update css-loader v2.0 to v1.0.That is ok! here

Sign up to request clarification or add additional context in comments.

1 Comment

Is it updated from v1 to v2? I am still having troubles on v3.6? Any ideas?
2

He means degrade to v1.0 ... Even now in 2021, the problem is still there, you have to choose between latest css-loader and typings-for-css-modules-loader... I checked the github repository and found the project hasn't been upgrated for 4years

1 Comment

Very helpful knowing this is abandonware. Is there something comparable to this loader that can be used instead?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.