Webpack: getting this error: build failed (from ./node_modules/css-loader/dist/cjs.js):

痞子三分冷 提交于 2021-02-10 14:53:17

问题


When running Webpack, I get the following error:

./src/css/main.css 3.62 KiB {0} [not cacheable] [built] [failed] [1 error]

ERROR in ./src/css/main.css Module build failed (from ./node_modules/css-loader/dist/cjs.js): ... accumulator[normalizedUrl] = { ...accumulator[normalizedUrl], ^^^ ...

webpack.config.js:

    module: {
      rules: [
        {
         test: /\.css$/i,
         use: ['css-loader']
        }
      ]
    }

css:

    body {
      background-color:purple;
    }

js:

    import css from '../css/main.css';

on js file, if I enter

    import '../css/main.css';

I get the same error.

I'd appreciate your help please.


回答1:


Resolved the issue by upgrading node.



来源:https://stackoverflow.com/questions/61830978/webpack-getting-this-error-build-failed-from-node-modules-css-loader-dist-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!