Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all articles
Browse latest Browse all 28474

React Native run-android interopRequireDefault error

$
0
0

I have a problem with running my (just created) React Native app. I read about

error Cannot find module '@babel/runtime/helpers/interopRequireDefault'

But changing every possible combination of package.json doesn't help.

"devDependencies": {
    "@babel/core": "^7.6.2",
    "@babel/runtime": "7.0.0-beta.55",
    "@react-native-community/eslint-config": "^0.0.5",
    "@types/jest": "^24.0.18",
    "@types/react-native": "^0.60.21",
    "@types/react-test-renderer": "16.9.1",
    "babel-jest": "^24.9.0",
    "eslint": "^6.6.0",
    "jest": "^24.9.0",
    "metro-react-native-babel-preset": "^0.57.0",
    "react-test-renderer": "16.12.0",
    "typescript": "^3.6.3"
  },

I've already changed @babel/runtime version as I found it in solutions but after react-native start I still get:

error Cannot find module '@babel/runtime/helpers/interopRequireDefault'. Run CLI with --verbose flag for more details.
Error: Cannot find module '@babel/runtime/helpers/interopRequireDefault'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:690:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (C:\Users\User\AppData\Local\Yarn\Data\global\node_modules\@react-native-community\cli-debugger-ui\build\middleware\index.js:3:30)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)

Funny thing is that after react-native run-android I see message that build is successful (in console) but I'm not able to run my app and get:

Unable to load script.Make sure you are either running a Metro server or that your bundle 'index.android.bundle' is packaged correctly for release.

on smartphone.


Viewing all articles
Browse latest Browse all 28474

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>