[Pit condition]--this dependency is not found: ' Element-ui/lib/theme-chalk/index.css '

Source: Internet
Author: User

Element UI Pit: Today pull code, dashing npm run Dev, was told: this dependency is not found: ' Element-ui/lib/theme-chalk/index.css ' .... Solution 1. No dependencies found, path problem

This is not scientific ah, yesterday can run through the code, today on the dog? But you also have to find the path-related answers, Magnum Niang on-line, mostly such, should be quoted as "./" Emmmm analyzed a wave not quite right ah! That's the way Elementui is quoted.

Import ' Element-ui/lib/theme-chalk/index.css ' 2. Take a look at the element website

It's really one of their bugs. Paste Link: https://github.com/ChenCheng0914/forum-vue/pull/2/commits/ BB03F0FCD8E8C348CB7398B3944C1F039CBB43B9 but look, the code is not consistent with my question.

3. Look at my vue and the element version is not secretly updated what

I'm wrong version of Vue 2.9.1 element 1.4.13 I go, is the element version so low? Uniform's version has been upgraded to Element 2.3.6 and then ran the NPM run Dev.

4.webpack Configuration

Do you think it's really settled? When I voluminous to move bricks one day, when the code was compiled, I was given an egg Module not Found:Error:Can ' t resolve ' element-ui/lib/theme-chalk/index.css ' my god Play me , Meng sister will be angry I tell you the right way: unexpectedly is compiled out of the wrong, Webpack walk a wave, through the element know the hint found to this word configuration webpack.config.js in loaders Plus

{test:/. (EOT|WOFF|TTF) $/, loader: ' Url-loader '}

The reason for this is that this happens because the module parsing fails and the. TTF format parsing module is missing, vue2.0 above, in Webpack.config.js

In module->rules Add {test:/. ( EOT|WOFF|TTF) $/, loader: ' Url-loader '}

Of course you also want to make sure that you have installed Url-loader intimate code NPM install URL-LOADER/CNPM install url-loader-d

5. Finally note

Correct way: Import ' ELEMENT-UI/LIB/THEME-CHALK/INDEX.CSS ' failure mode: import ' element-ui/lib/theme-default/index.css ' element Change the subject without synchronizing the code

Summarize:

If you encounter the same problem, the above methods should be available for you to answer.

[Pit condition]--this dependency is not found: ' Element-ui/lib/theme-chalk/index.css '

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.