Nuxt.js: 使用element-ui执行npm run build 时报错

Created on 18 Oct 2018  ·  14Comments  ·  Source: nuxt/nuxt.js

ERROR in ./node_modules/element-ui/lib/theme-chalk/index.css (./node_modules/css-loader??ref--3-oneOf-1-1!./node_modules/postcss-loader/src??ref--3-oneOf-1-2!./node_modules/element-ui/lib/theme-chalk/index.css)
Module build failed (from ./node_modules/postcss-loader/src/index.js):
TypeError: Cannot read property 'search' of undefined

无法完成编译,报错到底是哪里的问题?

This question is available on Nuxt community (#c7997)

Most helpful comment

The workaround right now is to disable the postcss by the following config:

// nuxt.config.js
    build: {
        postcss: false,
        extend ..
    }

All 14 comments

This issue as been imported as question since it does not respect nuxt.js issue template. Only bug reports and feature requests stays open to reduce maintainers workload.
If your issue is not a question, please mention the repo admin or moderator to change its type and it will be re-opened automatically.
Your question is available at https://cmty.app/nuxt/nuxt.js/issues/c7997.

+1

same issue

The workaround right now is to disable the postcss by the following config:

// nuxt.config.js
    build: {
        postcss: false,
        extend ..
    }

same issue

same issue!!!

@WangHansen well, It works....

同样问题。。。

it seems like issue with cssnano
https://github.com/cssnano/cssnano/issues/644

+1

@jhd4tmr it was already fixed in cssnano 4.1.7

@aldarund Actually it happened only in my main project. The others' projects are ok. But whatever versions of different packages i changed, the problem still exists in my main project. The main project used to be ^1.4.7 nuxt. I update nuxt, sass-loader ... element-ui and the all the other packages to the newest version, but the problem still exists. The main project is quite big, i solve the problem by adding the small components into the css config of nuxt.config.js like button.css, display.css. After I removed index.css, everything works fine. holy shit.

@jhd4tmr u need only updat cssnano to 4.1.7 to ger rid of error in this ticket

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gary149 picture gary149  ·  3Comments

shyamchandranmec picture shyamchandranmec  ·  3Comments

lazycrazy picture lazycrazy  ·  3Comments

vadimsg picture vadimsg  ·  3Comments

nassimbenkirane picture nassimbenkirane  ·  3Comments