question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

core-js module error

See original GitHub issue

Version

3.5.1

Environment info

mac os 10.14.3

Steps to reproduce

vue-cli-service serve --mode development

What is expected?

run the project correctly

What is actually happening?

With useBuiltIns option, required direct setting of corejs option 98% after emitting CopyPlugin ERROR Failed to compile with 36 errors 10:20:25 These dependencies were not found:

core-js/modules/es6.array.iterator in ./src/main.js, ./src/webapp/main.js core-js/modules/es6.function.name in ./src/main.js core-js/modules/es6.number.constructor in ./src/assets/js/utils.js core-js/modules/es6.object.assign in ./src/main.js, ./src/webapp/main.js core-js/modules/es6.object.to-string in ./src/main.js, ./src/assets/js/utils.js and 2 others core-js/modules/es6.promise in ./src/main.js, ./src/webapp/main.js core-js/modules/es6.regexp.match in ./src/assets/js/utils.js core-js/modules/es6.regexp.replace in ./src/main.js, ./src/assets/js/gt.js and 3 others core-js/modules/es6.regexp.split in ./src/assets/js/utils.js core-js/modules/es6.regexp.to-string in ./src/main.js, ./src/assets/js/utils.js and 1 other core-js/modules/es6.string.includes in ./src/store.js, ./src/main.js and 2 others core-js/modules/es6.string.iterator in ./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref–12-0!./node_modules/_babel-loader@8.0.5@babel-loader/lib!./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref–0-0!./node_modules/_vue-loader@15.7.0@vue-loader/lib??vue-loader-options!./src/views/assets/Index.vue?vue&type=script&lang=js& core-js/modules/es6.typed.uint8-array in ./src/assets/js/utils.js core-js/modules/es7.array.includes in ./src/store.js, ./src/main.js and 3 others core-js/modules/es7.promise.finally in ./src/main.js, ./src/webapp/main.js core-js/modules/web.dom.iterable in ./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref–12-0!./node_modules/_babel-loader@8.0.5@babel-loader/lib!./node_modules/_cache-loader@2.0.1@cache-loader/dist/cjs.js??ref–0-0!./node_modules/_vue-loader@15.7.0@vue-loader/lib??vue-loader-options!./src/views/assets/Index.vue?vue&type=script&lang=js&

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:57
  • Comments:30 (2 by maintainers)

github_iconTop GitHub Comments

266reactions
agrass-GitHubcommented, Mar 20, 2019

babel.config.js

presets: [ [ "@vue/app", { useBuiltIns: "entry" } ] ]

130reactions
zivyangllcommented, Mar 20, 2019

This is reason: https://babeljs.io/docs/en/babel-preset-env#usebuiltins

This option adds direct references to the core-js module as bare imports. Thus core-js will be resolved relative to the file itself and needs to be accessible. You may need to specify core-js@2 as a top level dependency in your application if there isn’t a core-js dependency or there are multiple versions.

So you can set: presets: [ [ “@vue/app”, { useBuiltIns: “entry” } ] ].

More important, you must set polyfills in code. ref: https://cli.vuejs.org/guide/browser-compatibility.html#usebuiltins-usage

if one of your dependencies has specific requirements on polyfills, by default Babel won’t be able to detect it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't resolve 'core-js/modules/es.error.cause.js' - Stack Overflow
I tried deleting the node_modules folder and then running npm install, but still, the same error. – Karim Jammoul. May 23 at 6:41....
Read more >
WebpackError: Cannot find module 'core-js/modules/es6.array ...
When it came to spinning up the development server I encountered this error: phalient@phalient-sp4:/mnt/c/projects/repos/techphlex-landing-site$ np > gatsby@3.0 ...
Read more >
babel/preset-env
This option merges the features of @babel/preset-modules without having to use ... it already includes core-js : importing it twice will throw an...
Read more >
FIXING THE CORE-JS ERROR - DEV Community ‍ ‍
copy the code in this github repo and paste in the file directory in node modules. If the error still persists. run npm...
Read more >
Can't resolve 'core-js/modules/es.error.cause.js'-Vue.js
Coding example for the question Module not found: Error: Can't resolve 'core-js/modules/es.error.cause.js'-Vue.js.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found