marklogic-community / grove-vue-ui

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

core-js dependencies not found..

grtjn opened this issue · comments

commented

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...
commented

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..

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.

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?

commented

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.

commented

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

commented

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

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!

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

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

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