stuudd
stuudd

Reputation: 369

React Native - Unable to resolve module `@babel/runtime/helpers/interopRequireDefault`

I upgraded my react native application from 0.48.3 to 0.59.8 everything works fine until lauching the emulator . Then this error appears :

   error: bundling failed: Error: Unable to resolve module 
   `@babel/runtime/helpers/interopRequireDefault` from 
    `E:\als\variant\generic\index.android.js`: Module 
    `@babel/runtime/helpers/interopRequireDefault` does not exist in the 
    Haste module map

Here is my Package.json :

  "dependencies": {
  "@babel/polyfill": "^7.4.4",
  "@babel/runtime": "^7.0.0-beta.55",
   "babel-loader": "^8.0.5",
   "content-disposition": "^0.5.2",
   "core-js": "^3.0.1",
   "react": "16.8.6",
   "react-dom": "16.8.6",
   "react-loader": "^2.4.5",
   "react-native": "0.59.8",
   "react-redux": "^5.0.6",
    "react-router-dom": "^5.0.0",
    "redux": "^3.7.2",
   "redux-thunk": "^2.2.0",

},
 "devDependencies": {
   "@babel/plugin-proposal-class-properties": "^7.4.4",
  "@babel/plugin-proposal-decorators": "^7.4.4",
  "@babel/plugin-proposal-nullish-coalescing-operator": "^7.4.4",
  "@babel/plugin-transform-block-scoping": "^7.0.0",
  "@babel/plugin-transform-flow-strip-types": "^7.4.4",
   "@babel/plugin-transform-react-jsx-source": "^7.2.0",
   "@babel/plugin-transform-runtime": "^7.4.4",
   "@babel/preset-env": "^7.4.3",
    "@babel/preset-flow": "^7.0.0",
    "@babel/preset-react": "^7.0.0",
      "babel-eslint": "^10.0.1",
     "babel-jest": "^24.8.0",
    "babel-preset-react-native": "^5.0.2",
 }

I have tried all solutions found in similar questions but not working .Have you any idea please ?

Upvotes: 5

Views: 6993

Answers (2)

David Evans Farinha
David Evans Farinha

Reputation: 51

I faced this same issue and no solutions mentioned on the threads worked. However I was finally able to solve it by removing and re-installing the global version of react-native:

npm uninstall react-native -g
npm install react-native@latest -g 

And the error then disappeared when I re-ran:

react-native start

Upvotes: 1

Anis D
Anis D

Reputation: 761

Try to reset cache with

npm run start --reset-cache

Upvotes: 4

Related Questions