Pkg: Can't resolve '@babel/runtime-corejs2/core-js/json/stringify'

Created on 25 May 2019  路  9Comments  路  Source: vercel/pkg

ran

pkg app.js -t node10-linux-x64 --output boxit

./boxit

Using "webpackDevMiddleware" config function defined in next.config.js.
Using external babel configuration
Location: "/home/shintaro/Desktop/projects/github/frontend/app/.babelrc"

Failed to compile.

/snapshot/frontend/node_modules/next/dist/client/event-source-polyfill.js
Module not found: Can't resolve '@babel/runtime-corejs2/core-js/json/stringify' in '/snapshot/frontend/node_modules/next/dist/client'

Most helpful comment

Solved the issue for me:
npm install --save-dev @babel/runtime-corejs2

All 9 comments

I already removed the babelrc, its not required i think..

I'm using this boilerplate
https://github.com/MustansirZia/next-express-bootstrap-boilerplate

thanks in advance

I have installed this
"@babel/runtime": "^7.3.4",
"@babel/runtime-corejs2": "^7.4.5",

but now fires this error

./app-linux

[ error ] /snapshot/frontend/node_modules/next-server/dist/lib/loadable.js
Module not found: Can't resolve '@babel/runtime-corejs2/core-js/array/is-array' in '/snapshot/frontend/node_modules/next-server/dist/lib'

can someone help

thanks

please check this:

https://github.com/babel/babel/issues/10030

many thanks

i found the same error in my project when i use an npm-link module.
but the module work fine if the module is published and install by the project.
so it's there any solutions?...

the error occur when the module have code like this:
Array.isArray();

Solved the issue for me:
npm install --save-dev @babel/runtime-corejs2

I am seeing a similar issue. Unfortunately the solution @benpetsch mentioned does not work. It did change the error slightly and now I am seeing this

 web  Failed to compile.
/usr/local/lib/node_modules/expo-cli/node_modules/react-error-overlay/lib/index.js
Module not found: Can't resolve '@babel/runtime-corejs2/core-js/array/from' in '/usr/local/lib/node_modules/expo-cli/node_modules/react-error-overlay/lib'

I am using expo with nextjs for web

note: @babel/runtime-corejs2/core-js/array/from exists in node_modules

Same issue here, however after npm install --save-dev @babel/runtime-corejs2 and successfully starting next dev, I just realized that there the server was not reloading anymore and time to time was getting stuck.

yarn @babel/runtime-corejs2 --dev

@benpetsch's fix worked for me

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ydubois-fr picture ydubois-fr  路  4Comments

ndrantotiana picture ndrantotiana  路  4Comments

gillez picture gillez  路  4Comments

ksmithut picture ksmithut  路  4Comments

Araknos picture Araknos  路  4Comments