-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Cannot find module 'core-js/library/xxx' when import element-ui #2275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @showmethecode9527 , thanks for the report.
|
I changed
|
i meet the same problem with you! Are you resolve it? |
Use |
This seems to be caused by vuepress's webpack configuration. element-ui requires async-validator 1.x which requires babel-runtime 6.x which requires core-js 2.x, while vuepress depends on core-js 3.x. I installed element-ui after vuepress and my node_modules folder looks like this: node_modules In file packages/@vuepress/core/lib/node/webpack/createBaseConfig.js, webpack's resolve.modules setting is changed:
I found that the new value does not contain babel-runtime 6.x 's local node_module folder, so module resolution of core-js 2.x would fail for babel-runtime. I tried changing line 333 to |
Is there any better way to solve this for me? It seems that I have conflicts with ant-design-vue, but sometimes I don't want to separate them into projects |
npm install [email protected] succ |
sometimes it works well, but not all the time. |
when you install [email protected], you must restart |
Execute this command |
Yes, it works!!!!! |
cool |
shit official docs 💩https://vuepress.vuejs.org/guide/directory-structure.html solution 1
$ yarn add [email protected]
# OR
$ npm i [email protected]
{
"devDependencies": {
"vuepress": "1.5.3"
},
"dependencies": {
+ "async-validator": "1.11.5",
"element-ui": "2.14.1"
}
}
solution 2
{
"devDependencies": {
- "vuepress": "1.5.3"
+ "vuepress": "^1.5.3"
},
"dependencies": {
- "element-ui": "2.14.1"
+ "element-ui": "^2.14.1"
}
}
|
I put this in module.exports = {
chainWebpack(config, isServer) {
if (!isServer) {
config.resolve.modules.merge(["node_modules"]);
}
return config;
},
} Thanks a lot. |
Uh oh!
There was an error while loading. Please reload this page.
Bug report
Steps to reproduce
Then create
docs/README.md
,docs/.vuepress/enhanceApp.js
Then run
vuepress dev docs
and open the browser's consoleWhat is expected?
build success
What is actually happening?
build error
Other relevant information
npx vuepress info
in my VuePress project:The text was updated successfully, but these errors were encountered: