question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Module @babel/runtime/helpers/interopRequireDefault does not exist in the Haste module map

See original GitHub issue

Environment

React Native Environment Info: System: OS: macOS High Sierra 10.13.6 CPU: x64 Intel® Core™ i5-6360U CPU @ 2.00GHz Memory: 408.65 MB / 8.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 8.12.0 - /usr/local/bin/node Yarn: 1.3.2 - /usr/local/bin/yarn npm: 6.4.1 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 12.0, macOS 10.14, tvOS 12.0, watchOS 5.0 Android SDK: Build Tools: 23.0.1, 23.0.2, 23.0.3, 25.0.0, 25.0.2, 25.0.3, 26.0.2, 26.0.3, 27.0.1, 27.0.2 API Levels: 23, 24, 25, 26, 27 IDEs: Android Studio: 3.0 AI-171.4443003 Xcode: 10.0/10A255 - /usr/bin/xcodebuild npmPackages: react: 16.5.0 => 16.5.0 react-native: 0.57.1 => 0.57.1 npmGlobalPackages: create-react-native-app: 1.0.0 react-native-cli: 2.0.1 react-native-git-upgrade: 0.2.7

Description

When starting a new project with react-native init then run iOS, I’m getting the error :

Module @babel/runtime/helpers/interopRequireDefault does not exist in the Haste module map

capture d ecran 2018-09-25 a 09 37 54

Reproducible Demo

react-native init myapp // FIX CFBundleIdentifier issue with react-native upgrade react-native run-ios Get the error.

FIX

The issue can be fix by doing: npm add @babel/runtime npm install But we shouldn’t have to do all this stuff !

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:594
  • Comments:89 (2 by maintainers)

github_iconTop GitHub Comments

351reactions
g4lauracommented, Oct 6, 2018

for now since a lot of new changes are coming out, this fix worked for me: with npm: npm install --save @babel/runtime or with yarn: yarn add @babel/runtime (edited: if you’re planning on waiting for the release that fixes this before releasing a new production build (like me) you can keep babel/runtime in devDependencies, but if you want to build a release build with this version of react-native, you need to put @babel/runtime in dependencies as the original poster said)

if on ios you get _this._registerEvents is not a function, after a successful build do npm run start --reset-cache or react-native start --reset-cache

edit: should add @babel/core, under resolutions, in package.json you may also need “babel-core”: “7.0.0-bridge.0” in resolutions but this is more for react-native projects being upgraded…

34reactions
OlegPanfyorovcommented, Sep 16, 2020

@hugoh59 Same for me, I’m really shocked. I tried everything. RN is a piece of shit

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to resolve module `@babel/runtime/helpers ...
I had to remove the node_modules and npm -i . This time when I checked the node_modules the interopRequireDefault.js file was there. Share....
Read more >
Module `@babel/runtime/helpers/interopRequireDefault` does ...
Coding example for the question Module `@babel/runtime/helpers/interopRequireDefault` does not exist in the Haste module map.
Read more >
Module not found: Can't resolve @babel/runtime/helpers
To solve the error "Module not found: Error: Can't resolve '@babel/runtime/helpers'", make sure to install the @babel/runtime package by opening your terminal ...
Read more >
at moduleresolver.resolvedependency - You.com - You.com
Unable to resolve module `@babel/runtime/helpers/interopRequireDefault` ... with the react native metro bundler (" does not exist in the Haste module map").
Read more >
React-native – Unable to resolve module `@babel/runtime ...
... Module `@babel/runtime/helpers/interopRequireDefault` does not exist in the Haste module map This might be related to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found