Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to resolve "@babel/runtime/helpers/builtin/interopRequireDefault" #216

Closed
outaTiME opened this issue May 16, 2018 · 42 comments
Closed

Comments

@outaTiME
Copy link

outaTiME commented May 16, 2018

Hi guys, today I update yup to 0.25.0 and im getting the following error:

Unable to resolve "@babel/runtime/helpers/builtin/interopRequireDefault" from "node_modules/yup/lib/index.js"
Failed building JavaScript bundle.

Rolling back to v0.24.1 fix the issue, any advice?

@hvolschenk
Copy link

Getting a similar issue since upgrading to 0.25.0:

ERROR in ./node_modules/yup/lib/object.js
Module not found: Error: Can't resolve '@babel/runtime/helpers/builtin/taggedTemplateLiteralLoose' in '/home/node/app/node_modules/yup/lib'

@k7sleeper
Copy link

Quick fix: npm add @babel/runtime

@jquense
Copy link
Owner

jquense commented May 17, 2018

Upgrade please, fix released thanks!

@jquense jquense closed this as completed May 17, 2018
@hua-lu
Copy link

hua-lu commented Aug 6, 2018

I have the same issue and installing the latest babel/runtime doesn't work for me

@hielkehoeve
Copy link

hielkehoeve commented Aug 6, 2018

Everyone probably already has @babel/runtime as dependencies. Unfortunately Babel has removed the builtin helpers since v7.0.0-beta.56 (3 days ago). Since npm doesn't automatically update most people won't have this problem.

Try installing v7.0.0-beta.55, this fixes your problem:

...
    "@babel/runtime": "7.0.0-beta.55",
...
}```

@hielkehoeve
Copy link

hielkehoeve commented Aug 6, 2018

@jquense Since you are referencing to babel runtime helper files directly it might be a good idea to update yup to use the correct babel/runtime/helpers using babel/runtime v7.0.0-beta.56 paths or depend on v7.0.0-beta.55 at most?

Babel has decided to move all builtin runtime helpers to a separate package:
babel/babel@a8224d4

@nfantone
Copy link

nfantone commented Aug 6, 2018

I'm having the same issue but on @babel/runtime 7.0.0-beta.46 (which is what latest CRA 2.0 uses).

EDIT

Can confirm that upgrading to @babel/runtime 7.0.0-beta.55 resolves the issue. Unfortunately, it's currently incompatible with create-react-app next.3e165448.

@bbakersmith
Copy link
Contributor

Instead of pulling in the latest @babel/runtime beta version, perhaps this should be pinned to a specific version?

https://github.com/jquense/yup/blob/v0.26.0/package.json#L86

clarencenpy added a commit to apollographql/apollo-server that referenced this issue Aug 7, 2018
@soulclown
Copy link

Same here. I Solved pinning the version: "@babel/runtime": "7.0.0-beta.55" :(

@Jtango18
Copy link

Installing yup@^0.26.2 resolves this.

@SirPhemmiey
Copy link

SirPhemmiey commented Aug 17, 2018

@nfantone "@babel/runtime": "7.0.0-beta.55" works and it's compatible with create-react-app.
Thanks for this @hielkehoeve

make-github-pseudonymous-again added a commit to infoderm/patients that referenced this issue Aug 19, 2018
pin @babel/* to 7.0.0-beta.55
see for instance jquense/yup#216
@kisenka
Copy link

kisenka commented Aug 20, 2018

@jquense looks like 0.26.2 was published with old runtime which relies on @babel/runtime@7.0.0-beta.55, could you please publish new version with actual runtime?

@jquense
Copy link
Owner

jquense commented Aug 20, 2018

@kisenka 0.26.2 is up to date and working

@woile
Copy link

woile commented Sep 24, 2018

I'm still having this issue with yup@0.26.6. I'm also using CRA, but as far as I've read it shouldn't matter right?

./node_modules/yup/lib/Lazy.js
Module not found: Can't resolve '@babel/runtime/helpers/objectWithoutPropertiesLoose' in './node_modules/yup/lib'

@infaz
Copy link

infaz commented Sep 26, 2018

Try -> npm add babel-preset-react-native
It worked for me.

er3n added a commit to er3n/felesel that referenced this issue Sep 26, 2018
@huuhuybn
Copy link

I'm still having this issue with yup@0.26.6. I'm also using CRA, but as far as I've read it shouldn't matter right?

./node_modules/yup/lib/Lazy.js
Module not found: Can't resolve '@babel/runtime/helpers/objectWithoutPropertiesLoose' in './node_modules/yup/lib'

hello. have you fixed it yet ?

@phandinhai
Copy link

npm add @babel/runtime

ths you.

@MingyuJeon
Copy link

Same problem and I resolved by install @babel/runtime: '^7.0.0'

@ropoja
Copy link

ropoja commented Sep 27, 2018

Quick fix: npm add @babel/runtime

Had this issue after creating react native app with react-native cli, solved with this. Thank you.

@cluis13915
Copy link

cluis13915 commented Sep 28, 2018

I solve same issue and I share you what happen.
The error was in step 3: Configure the ANDROID_HOME environment variable

For some reason the .bash_profile isn't loaded at shell starts. So I put the stuffs in .profile file, but did not work either. Finally I put all in .bashrc file and configure my terminal (Terminator) to NOT run commands as a login shell.

After that I was able to see the correct path with echo $ANDROID_HOME, running react-native run-android lauched successfully my "Welcome to React Native!" app.

@cluis13915
Copy link

Sorry ! I forgot to say that I also had to run:

npm add @babel/runtime

@rootguigui
Copy link

npm add @babel/runtime to me it's working.... thanks for help

@jquense
Copy link
Owner

jquense commented Sep 29, 2018

Y'all upgrade yup to the latest, delete you lock file and node_modules and reinstall. That should fix it. If you still have the issue something is broken in your build setup

@scheffeld
Copy link

npm add @babel/runtime

Nice man, work for me.

@DavidPr0
Copy link

Opa estava com o mesmo erro e resolvido com o comando
npm add @babel/runtime

@tophertoy
Copy link

react-native run-android

Similar issue for me. I use ZSH and even though echo $ANDROID_HOME works in ZSH it wasn't working when running react-native run-ios

Adding this to .bashrc fix it:

export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/emulator

@naxir
Copy link

naxir commented Oct 2, 2018

lol developer whole life #FUN #Family #Code 👍
npm add @babel/runtime lolzz

@arobbins
Copy link

arobbins commented Oct 2, 2018

npm add @babel/runtime worked for me as well.

@wixys
Copy link

wixys commented Oct 3, 2018

Quick fix: npm add @babel/runtime

Worked for me, many thanks!

@lasersox
Copy link

lasersox commented Oct 6, 2018

None of these have worked for me :(

@ryadaval
Copy link

ryadaval commented Oct 9, 2018

Quick fix: npm add @babel/runtime

This worked for me.

@okanthony
Copy link

okanthony commented Oct 10, 2018

The error I was experiencing was related to yup:

Cannot find module '@babel/runtime/helpers/builtin/interopRequireDefault' from 'index.js'

      at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:221:17)
      at Object.<anonymous> (node_modules/yup/lib/index.js:3:30)

I added @babel/runtime and upgraded yup to 0.26.2 which fixed it

@kdawgwilk
Copy link

I am seeing this error when trying to run storybooks when using RN 0.56. I am starting up storybooks by using react-native start --projectRoots pwd/storybook --reset-cache none of the above steps have helped

@andileka
Copy link

This worked for me.
yarn add @babel/runtime --dev

@activescott
Copy link
Contributor

@babel/rutnime@7.1.2 did not work. I am having to downgrade @babel/runtime with the following command to get yup to work:

yarn upgrade @babel/runtime@7.0.0-beta.55

Using the latest of @babel/runtime and yup still gives the original error:

Error: Cannot find module '@babel/runtime/helpers/builtin/interopRequireDefault'

Deleting yarn.lock and node_modules/ did not help.

@onekiloparsec
Copy link

I confirm too that @babel/runtime@7.1.5 did not work. Downgrading to -beta.55 worked though.

@vincentjames501
Copy link
Contributor

adding dev dependency @babel/runtime 7.1.5 did work for me. I suspect that if yup updated its package.json to 7.1.5 it may fix the issue for most people here.

@SerkoNikolas
Copy link

SerkoNikolas commented Nov 29, 2018

I have added @babel/runtime 7.1.5, but the error still exists. Yup ver. 0.26.6
I deleted node_modules folder before installing

@jplwood
Copy link

jplwood commented Dec 12, 2018

Y'all upgrade yup to the latest, delete you lock file and node_modules and reinstall. That should fix it. If you still have the issue something is broken in your build setup

@jquense could you elaborate by what you mean when say something is broken in your build setup ? I only get this error when I import yup into a file. I've tried what you suggested as well as a number of other things in this thread to no avail 😞

I'm on Yup v0.26.6

@nathanhannig
Copy link

found same issue with this plugin jquense/react-formal#155

@bilalmajeed64
Copy link

Kindly please resolve this issue... i just tried all the solution given up but its not working
I created project by "create-react-native-app . " and then "npm run eject". its not working for me
screen shot 2018-12-28 at 17 36 50

@jquense
Copy link
Owner

jquense commented Dec 28, 2018

this has been fixed a long time ago, if you are still having issues there is something wrong with the copy you've installed or you have an old version

Repository owner locked as resolved and limited conversation to collaborators Dec 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests