Element: Module build failed: Error: No PostCSS Config found in: D:\vue\element-ui\node_modules\[email protected]@element-ui\lib\theme-default

Created on 20 Mar 2018  ·  3Comments  ·  Source: ElemeFE/element

ERROR in ./node_modules/[email protected]@css-loader!./node_modules/_postcss[email protected]@postcss-loader/lib!./node_modules/_element[email protected]@element-ui/lib/theme-defa
ult/index.css
Module build failed: Error: No PostCSS Config found in: D:\vue\[email protected]@element-ui\lib\theme-default
at Error (native)
at D:\vue\[email protected]@postcss-load-config\index.js:51:26
@ ./node_modules/[email protected]@element-ui/lib/theme-default/index.css 4:14-145 18:2-22:4 19:20-151
@ ./src/main.js
@ multi webpack-dev-server/client?http://0.0.0.0:8888/ webpack/hot/dev-server webpack-hud ./src/main.js
webpack: Failed to compile.

Most helpful comment

需要在 postcssloader ,里声明一个配置项: plugins 字段,空数组即可。
const postcssLoader = { loader: 'postcss-loader', options: { sourceMap: options.sourceMap, plugins: [], // 吐血,这个地方要声明,不然安装 elementui 会报错 } }

All 3 comments

Hello, this issue has been closed because it does not conform to our issue requirements. Please submit issues with issue-generator. More info can be found in #3693.

需要在 postcssloader ,里声明一个配置项: plugins 字段,空数组即可。
const postcssLoader = { loader: 'postcss-loader', options: { sourceMap: options.sourceMap, plugins: [], // 吐血,这个地方要声明,不然安装 elementui 会报错 } }

碰到同样问题,困扰了半天,解决办法:

  1. 在项目根路径下添加postcss.config.js,参考https://blog.csdn.net/qq_41831345/article/details/80636053
  2. 按楼上yanyang1116的方法设置下postcssloader。

两步骤都做了,才解决

Was this page helpful?
0 / 5 - 0 ratings

Related issues

no5no6 picture no5no6  ·  3Comments

makunsusu picture makunsusu  ·  3Comments

Kingwl picture Kingwl  ·  3Comments

yorululu picture yorululu  ·  3Comments

dbskccc picture dbskccc  ·  3Comments