Parcel CLI cannot resolve the core-js@3's array module.
Seems like it is looking for the wrong module. It is looking for "core-js/modules/es6.array.copy-within", while I have "core-js/modules/es.array.copy-within" in my "node_modules".
package.json:
{
"name": "parcel_test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"dev": "parcel watch src/app.html -d app --public-url .",
"build": "parcel build src/app.html -d app --public-url . --no-content-hash"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"core-js": "^3.1.4",
"vue": "^2.6.10"
},
"devDependencies": {
"parcel-bundler": "^1.12.3",
"@babel/core": "^7.5.5",
"@vue/component-compiler-utils": "^3.0.0",
"vue-template-compiler": "^2.6.10",
"vue-hot-reload-api": "^2.3.3"
}
}
CLI command:
parcel build src/app.html -d app --public-url . --no-content-hash
I don't have a babel config.
Should compile
parcel_test/src/index.js: Cannot resolve dependency 'core-js/modules/es6.array.find-index'
at Resolver.resolve (/Users/hsong/workspace/JS/parcel_test/node_modules/parcel-bundler/src/Resolver.js:71:17)
at async Bundler.resolveAsset (/Users/hsong/workspace/JS/parcel_test/node_modules/parcel-bundler/src/Bundler.js:433:18)
at async Bundler.resolveDep (/Users/hsong/workspace/JS/parcel_test/node_modules/parcel-bundler/src/Bundler.js:484:14)
at async /Users/hsong/workspace/JS/parcel_test/node_modules/parcel-bundler/src/Bundler.js:608:26
at async Promise.all (index 4)
at async Bundler.loadAsset (/Users/hsong/workspace/JS/parcel_test/node_modules/parcel-bundler/src/Bundler.js:599:21)
at async /Users/hsong/workspace/JS/parcel_test/node_modules/parcel-bundler/src/Bundler.js:610:13
at async Promise.all (index 0)
at async Bundler.loadAsset (/Users/hsong/workspace/JS/parcel_test/node_modules/parcel-bundler/src/Bundler.js:599:21)
at async Bundler.processAsset (/Users/hsong/workspace/JS/parcel_test/node_modules/parcel-bundler/src/Bundler.js:557:5)
at async PromiseQueue._runJob (/Users/hsong/workspace/JS/parcel_test/node_modules/parcel-bundler/src/utils/PromiseQueue.js:48:7)
Workaround: use @babel/polyfill or core-js@2 instead.
Build apps.
N/A
| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | parcel-bundler 1.12.3
| Node | 12.6.0
| npm/Yarn | 6.10.2
| Operating System | macOS Mojave 10.14.6
Hi,
any workaround for this issue ?
Thanks
Hi,
any workaround for this issue ?
Thanks
The workaround I am using is to install and use @babel/polyfill or core-js@2 instead.
@fnick851 Use import 'core-js/stable';
instead.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs.
Hi, you can use this version of core-js for fixing that problem.
yarn add [email protected]
Most helpful comment
@fnick851 Use
import 'core-js/stable';
instead.See: https://babeljs.io/docs/en/babel-polyfill