problem
In the project built by the latest Vue 3.2 + Vue cli 4.5, the method of introducing element plus in the old version of vue3 was initially followed, and all style files of element plus were introduced in main.js with the following statement:
import 'element-plus/lib/theme-chalk/index.css';
However, an error is reported:
Failed to compile. ./src/main.js Module not found: Error: Can't resolve 'element-plus/lib/theme-chalk/index.css' in 'E:\sourceFiles\map-survey\src'
Since it was introduced in this way before, I felt it was outrageous when reporting an error
solve
The solution is also very simple. Now that you have installed the element plus dependency, you can’t find the file. The probability is that the path has changed. So I manually turned to node modules and found that the whole theme chat folder was moved.
Therefore, the statement introducing the style is changed to:
import 'element-plus/theme-chalk/index.css'
Error reporting can be solved. I hope I can help friends who have just contacted Vue + element
Similar Posts:
- These dependencies were not found: * throttle-debounce/debounce in ./node_modules/element-ui/lib/tooltip.js * throttle-debounce/throttle in ./node_modules/element-ui/lib/element-ui.common.js
- [Solved] Selenium Error: ElementClickInterceptedException
- How to Solve Request failed with status code 404
- Selenium: How to Solve Staleelementreferenceexception error (Three Methods)
- Mybatis where 1 = 1 and Tags
- ERROR in ./~/[email protected]@element-ui/lib/element-ui.common.js Module not found: Error: Can’t re
- [Solved] Vue/cli install element error: Error: cannot find module ‘Babel plugin component’
- [Solved] Module build failed: from ./node_modules/mini-css-extract-plugin/dist/loader.js
- InvalidSelectorError: Compound class names not permitted [How to Solve]
- Selenium Error: ElementNotInteractableException: Message: element not interactable