profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/reactnative/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

reactnative/reactnative.com 11

Use React Native to build native iOS and Android apps with JS

issue closedreactnative/reactnative.com

ERROR ReferenceError: Can't find variable: r

Whenever I run my React Native project (after removing node_modules, .gradle, .idea, android/app/build, android/build) I get the following error in my metro server:

info Reloading app...
[Fri Jun 11 2021 14:46:49.120]  BUNDLE  ./index.js 

[Fri Jun 11 2021 14:46:50.778]  ERROR    ReferenceError: Can't find variable: r
[Fri Jun 11 2021 14:46:50.780]  ERROR    Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
[Fri Jun 11 2021 14:46:50.782]  ERROR    Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)

exported = true is in all my activity entries in manifest:

<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" 
      android:exported="true"/>

This is my package.json:

{
  "name": "HeraMedica",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start --reset-cache",
    "test": "jest",
    "lint": "eslint .",
    "postinstall": "patch-package"
  },
  "dependencies": {
    "@react-native-async-storage/async-storage": "^1.15.4",
    "@react-native-community/clipboard": "^1.5.1",
    "@react-native-community/datetimepicker": "^2.6.2",
    "@react-native-community/masked-view": "^0.1.10",
    "@react-native-community/netinfo": "^6.0.0",
    "@react-native-google-signin/google-signin": "^6.0.0",
    "@react-native-picker/picker": "^1.15.0",
    "@react-navigation/drawer": "^5.12.5",
    "@react-navigation/material-top-tabs": "^5.3.15",
    "@react-navigation/native": "^5.9.3",
    "@react-navigation/stack": "^5.14.3",
    "moment": "^2.29.1",
    "patch-package": "^6.4.7",
    "postinstall-postinstall": "^2.1.0",
    "react": "16.13.1",
    "react-native": "0.63.4",
    "react-native-crypto-js": "^1.0.0",
    "react-native-fbsdk": "^3.0.0",
    "react-native-gesture-handler": "^1.10.3",
    "react-native-keyboard-aware-scroll-view": "^0.9.4",
    "react-native-linear-gradient": "^2.5.6",
    "react-native-localize": "^2.1.0",
    "react-native-material-dropdown": "^0.11.1",
    "react-native-material-textfield": "^0.16.1",
    "react-native-modal-datetime-picker": "^9.2.3",
    "react-native-pager-view": "^5.1.10",
    "react-native-picker-select": "^8.0.4",
    "react-native-reanimated": "^2.1.0",
    "react-native-safe-area-context": "^3.2.0",
    "react-native-screens": "^2.18.1",
    "react-native-switch": "^2.0.0",
    "react-native-tab-view": "^3.0.1",
    "react-native-table-component": "^1.2.1",
    "react-redux": "^7.2.2",
    "redux": "^4.0.5",
    "redux-persist": "^6.0.0",
    "redux-thunk": "^2.3.0"
  },
  "devDependencies": {
    "@babel/core": "^7.8.4",
    "@babel/runtime": "^7.8.4",
    "@react-native-community/eslint-config": "^1.1.0",
    "babel-jest": "^25.1.0",
    "eslint": "^6.5.1",
    "jest": "^25.1.0",
    "metro-react-native-babel-preset": "^0.59.0",
    "react-test-renderer": "16.13.1"
  },
  "jest": {
    "preset": "react-native"
  }
}

I don't have a clue where this error is coming from.

UPDATE:

When I am in another branch of the same repository using same package.json configuration, I am getting other errors:

Error: EISDIR: illegal operation on a directory, read
    at Object.readSync (fs.js:592:3)
    at tryReadSync (fs.js:366:20)
    at Object.readFileSync (fs.js:403:19)
    at UnableToResolveError.buildCodeFrameMessage (/Users/lion/Documents/Companies/Flex_project/TeleMedicine/React/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:304:17)
    at new UnableToResolveError (/Users/lion/Documents/Companies/Flex_project/TeleMedicine/React/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:290:35)
    at ModuleResolver.resolveDependency (/Users/lion/Documents/Companies/Flex_project/TeleMedicine/React/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:168:15)
    at DependencyGraph.resolveDependency (/Users/lion/Documents/Companies/Flex_project/TeleMedicine/React/node_modules/metro/src/node-haste/DependencyGraph.js:353:43)
    at /Users/lion/Documents/Companies/Flex_project/TeleMedicine/React/node_modules/metro/src/lib/transformHelpers.js:271:42
    at Server.<anonymous> (/Users/lion/Documents/Companies/Flex_project/TeleMedicine/React/node_modules/metro/src/Server.js:842:41)
    at Generator.next (<anonymous>)

closed time in 8 days

abhsax130778

issue commentreactnative/reactnative.com

ERROR ReferenceError: Can't find variable: r

I could locate where this 'r' is: https://imgur.com/a/1TOTS1q But there are other errors.

abhsax130778

comment created time in 8 days

issue commentreactnative/reactnative.com

ERROR ReferenceError: Can't find variable: r

I would like to see other updates of mine at: https://stackoverflow.com/questions/67938327/error-referenceerror-cant-find-variable-r

abhsax130778

comment created time in 8 days

issue openedreactnative/reactnative.com

ERROR ReferenceError: Can't find variable: r

Whenever I run my React Native project (after removing node_modules, .gradle, .idea, android/app/build, android/build) I get the following error in my metro server:

info Reloading app...
[Fri Jun 11 2021 14:46:49.120]  BUNDLE  ./index.js 

[Fri Jun 11 2021 14:46:50.778]  ERROR    ReferenceError: Can't find variable: r
[Fri Jun 11 2021 14:46:50.780]  ERROR    Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
[Fri Jun 11 2021 14:46:50.782]  ERROR    Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)

exported = true is in all my activity entries in manifest:

<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" 
      android:exported="true"/>

This is my package.json:

{
  "name": "HeraMedica",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "start": "react-native start --reset-cache",
    "test": "jest",
    "lint": "eslint .",
    "postinstall": "patch-package"
  },
  "dependencies": {
    "@react-native-async-storage/async-storage": "^1.15.4",
    "@react-native-community/clipboard": "^1.5.1",
    "@react-native-community/datetimepicker": "^2.6.2",
    "@react-native-community/masked-view": "^0.1.10",
    "@react-native-community/netinfo": "^6.0.0",
    "@react-native-google-signin/google-signin": "^6.0.0",
    "@react-native-picker/picker": "^1.15.0",
    "@react-navigation/drawer": "^5.12.5",
    "@react-navigation/material-top-tabs": "^5.3.15",
    "@react-navigation/native": "^5.9.3",
    "@react-navigation/stack": "^5.14.3",
    "moment": "^2.29.1",
    "patch-package": "^6.4.7",
    "postinstall-postinstall": "^2.1.0",
    "react": "16.13.1",
    "react-native": "0.63.4",
    "react-native-crypto-js": "^1.0.0",
    "react-native-fbsdk": "^3.0.0",
    "react-native-gesture-handler": "^1.10.3",
    "react-native-keyboard-aware-scroll-view": "^0.9.4",
    "react-native-linear-gradient": "^2.5.6",
    "react-native-localize": "^2.1.0",
    "react-native-material-dropdown": "^0.11.1",
    "react-native-material-textfield": "^0.16.1",
    "react-native-modal-datetime-picker": "^9.2.3",
    "react-native-pager-view": "^5.1.10",
    "react-native-picker-select": "^8.0.4",
    "react-native-reanimated": "^2.1.0",
    "react-native-safe-area-context": "^3.2.0",
    "react-native-screens": "^2.18.1",
    "react-native-switch": "^2.0.0",
    "react-native-tab-view": "^3.0.1",
    "react-native-table-component": "^1.2.1",
    "react-redux": "^7.2.2",
    "redux": "^4.0.5",
    "redux-persist": "^6.0.0",
    "redux-thunk": "^2.3.0"
  },
  "devDependencies": {
    "@babel/core": "^7.8.4",
    "@babel/runtime": "^7.8.4",
    "@react-native-community/eslint-config": "^1.1.0",
    "babel-jest": "^25.1.0",
    "eslint": "^6.5.1",
    "jest": "^25.1.0",
    "metro-react-native-babel-preset": "^0.59.0",
    "react-test-renderer": "16.13.1"
  },
  "jest": {
    "preset": "react-native"
  }
}

I don't have a clue where this error is coming from.

  1. Seeing to AppRegistry.js, there are lots of errors because typeScript support is not there. Is this the reason of the error? Have I to include support for typescript?

  2. For type-script support, this is a mandate that file should have .tsx extension. When I tried it with AppRegistry.js => AppRegistry.tsx, certain import, type errors were still there, then I thought type-script support is not needed. ReactNative handles it easily. I have seen certain AweSomeProject examples that use action script but ReactNative compiles it easily.

created time in 9 days