Skip to content
This repository has been archived by the owner on Jan 20, 2023. It is now read-only.

core-js dependencies not found.. #16

Open
grtjn opened this issue Mar 13, 2020 · 10 comments
Open

core-js dependencies not found.. #16

grtjn opened this issue Mar 13, 2020 · 10 comments
Labels
bug Something isn't working

Comments

@grtjn
Copy link
Contributor

grtjn commented Mar 13, 2020

Something has changed in babel or one of the core dependencies, so core-js needs to be added to main.js:

These dependencies were not found:

  • core-js/modules/es.array.concat
    etc...
@grtjn grtjn added the bug Something isn't working label Mar 13, 2020
@grtjn
Copy link
Contributor Author

grtjn commented Mar 13, 2020

It seems to be related to changes in babel@7 and core-js@3.

Doing:

npm install --save core-js

And adding this to the top of ui/src/main.js:

import 'core-js'

Seems to solve the issue..

@luistrcastro
Copy link

I didn't need to add "import 'core-js'" in my main.js file, just the first instruction already solve the problem. Thank you very much.

@falconair
Copy link

I'm still having this issue. I'm not a web or node developer so I'm picking up a project from 3 years ago. It used to build and serve web pages. My packages.json file shows Vue dependency of version 2.5.16.

When I do vue serve, I get this error:

These dependencies were not found:

* core-js/fn/regexp/escape in ../node_modules/babel-polyfill/lib/index.js
* core-js/library/fn/array/from in ../node_modules/babel-runtime/core-js/array/from.js
* core-js/library/fn/get-iterator in ../node_modules/babel-runtime/core-js/get-iterator.js
* core-js/library/fn/is-iterable in ../node_modules/babel-runtime/core-js/is-iterable.js
* core-js/library/fn/json/stringify in ../node_modules/babel-runtime/core-js/json/stringify.js
* core-js/library/fn/number/is-nan in ../node_modules/babel-runtime/core-js/number/is-nan.js
* core-js/library/fn/object/assign in ../node_modules/babel-runtime/core-js/object/assign.js
* core-js/library/fn/object/create in ../node_modules/babel-runtime/core-js/object/create.js
* core-js/library/fn/object/define-property in ../node_modules/babel-runtime/core-js/object/define-property.js
* core-js/library/fn/object/entries in ../node_modules/babel-runtime/core-js/object/entries.js
* core-js/library/fn/object/freeze in ../node_modules/babel-runtime/core-js/object/freeze.js
* core-js/library/fn/object/get-prototype-of in ../node_modules/babel-runtime/core-js/object/get-prototype-of.js
* core-js/library/fn/object/is in ../node_modules/babel-runtime/core-js/object/is.js
* core-js/library/fn/object/keys in ../node_modules/babel-runtime/core-js/object/keys.js
* core-js/library/fn/object/set-prototype-of in ../node_modules/babel-runtime/core-js/object/set-prototype-of.js
* core-js/library/fn/object/values in ../node_modules/babel-runtime/core-js/object/values.js
* core-js/library/fn/promise in ../node_modules/babel-runtime/core-js/promise.js
* core-js/library/fn/set in ../node_modules/babel-runtime/core-js/set.js
* core-js/library/fn/symbol in ../node_modules/babel-runtime/core-js/symbol.js
* core-js/library/fn/symbol/iterator in ../node_modules/babel-runtime/core-js/symbol/iterator.js
* core-js/shim in ../node_modules/babel-polyfill/lib/index.js

The message also says that I can do npm install --save core-js/fn/regexp/escape core-js-library/fn/..... for a large number of packages. When I execute that, I get another error about not being able to find these files.

In any case, I installed core-js, as suggested here and even added it to my package.json file and did npm install. I included core-js in my main.js, still get the same error.

Any ideas?

@grtjn
Copy link
Contributor Author

grtjn commented Feb 27, 2021

Can you print the full contents of your package.json file? Most importantly the dependencies bits? I'd also be interested to see the output of npm outdated. I suspect there is some mismatch between babel, and core-js. It might be necessary to be more accurate about which versions to pick.

@grtjn
Copy link
Contributor Author

grtjn commented Feb 27, 2021

Various comments related to babel and core-js can be found here. There might be useful hints in there too: vuejs/vue-cli#3678

@grtjn
Copy link
Contributor Author

grtjn commented Feb 27, 2021

One useful hint might be to make sure core-js v2 is installed, and not core-js v3. This can be done with npm install --save corejs@2

@falconair
Copy link

One useful hint might be to make sure core-js v2 is installed, and not core-js v3. This can be done with npm install --save corejs@2

I bet this is the problem. I'll try it. Thanks!

@yousuff-tekhne
Copy link

Hi all, some strange thing happen in main.js.
import { from } from "core-js/core/array";
This line got added removed this one and started working fine

@arjunvasan
Copy link

Thank you all - yousuff-tekhne solution worked for me. Not sure how/why this line got added:
import { from } from "core-js/core/array";
I think it got added automatically when I started using some Array functions (.forEach) and did not get removed.
After manually removing it, started working fine (I still had forEach in my code, So this import is not needed

@christine927t
Copy link

@arjunvasan Thank you for this! This is exactly what was happening to me so removing the import fixed my code as well.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants