Uncaught TypeError: Cannot read property 'apply' of undefined in React Native Debugger - react-native

react native 0.17
Ubuntu 14.04
I Just updated my react native version 0.16 to 0.17 then I try to connect my chrome debugger but I getting this error: --
Uncaught TypeError: Cannot read property 'apply' of undefined
in chrome console

This can cause due to several reasons.
This can occur due to peer-dependencies which are not compatible with your current react-native version.
Solution for this could be upgrading react-native using react-native upgrade, or changing the module or the peer-dependency to a compatible one with your react-native version
This can occur, if you are not using redux dev tools for Google Chrome.
Solution is to add redux dev tools (Issue).
Some issue with your implementation. Somewhere in your code must have a bug that you would not note and that will give the undefined error.
Solution is to check where and when this exception is thrown out and find the bug
For more readings Issue

Related

How to fix TypeError: null is not an object (evaluating '_reactNative.NativeModules.RNShare.FACEBOOK') when importing Share from react native share?

I am trying to create a share button with react native but when I import the Share library import Share from 'react-native-share'; I keep getting the following error:
TypeError: null is not an object (evaluating '_reactNative.NativeModules.RNShare.FACEBOOK')
ERROR Invariant Violation: "main" has not been registered. This can happen if:
Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
A module failed to load due to an error and AppRegistry.registerComponent wasn't called.
I tried installing and uninstalling the library, linking and unlinking it but I got no result.
I am using android.

react-native-fs not working on react-native version 0.69

I am using react-native version 0.69 and I want to read a file stored in assets in my react native project.
using following syntax in App.js
import fs from 'react-native-fs';
I have installed 'react-native-fs' and followed all the links I could find on the internet but I am still getting below error while running the app.
ERROR TypeError: null is not an object (evaluating 'RNFSManager.RNFSFileTypeRegular')
ERROR Invariant Violation: "main" has not been registered. This can happen if:
* Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current
project.
* A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called.
I tried to run react-native link react-nativs-fs but link support has been removed in react-native >= 60 as mentioned in official docs,
I am unable to get this to work, any help would be appreciated. I have seen similar issues on the stackoverflow but none has given the answer for react native >=0.60 versions
Also I am using expo to create the app.
my OS is Windows 10 64 bit.
react-native-fs is not supported with Expo but it is only supported by Pure React Native.
Expo has a package that offers filesystem support:
expo-file-system

Cannot read property 'cache' of undefined error after upgrading React Native

Metro bundler building fails when running react-native app with the following error,
bundling failed:
node_modules/react-native-draftjs-render/index.js:app/node_modules/react-native-draftjs-render/index.js:
Cannot read property 'cache' of undefined
How to fix this..? I'm in the middle of upgrading my react-native project to 0.61.5. (I'm really new to react-native)
I come across this issue again while upgrading my project to React Native 0.63.2. I don't remember how I resolved this last time. This time I was using react-native-draftjs-render version 2.9.0 and the issue resolved after downgrading to 2.8.3.

Got JS Exception: ReferenceError: Can't find variable: process

After upgrading from react-native 0.26 to 0.29 (and running react-native upgrade), I'm getting the following error in the android debugger:
Got JS Exception: ReferenceError: Can't find variable: process
And this error message in the android emulator
java.lang.RunTimeException: ReferenceError: can't find variable process
(http://10.0.2.2:8081/index.android.bundle (...)
I haven't changed any of my app javascript since upgrading, and everything ran without errors before so I'm assuming the problem isn't in the javascript, but rather the change of react versions has removed the 'process' variable?
Even loading an empty index file (a single react component that does nothing) still results in the same error.
Had the same issue:
java.lang.RuntimeException: java.util.concurrent.ExecutionException:
java.lang.RuntimeException: ReferenceError: Can't find variable: process
Fixed by upgrading the React to the latest compatible version, 15.2.1 in my case:
npm i react#15.2.1 --save
I had this issue, it turns out my problem was that I didn't stop and restart the packager after upgrading react-native.

"babelHelpers.interopRequireDefault is not a function" when upgrading to React Native 0.16.0-rc

I upgraded to react-native 0.16.0-rc, ran npm install, then ran react-native upgrade. When trying to launch the iOS app in a simulator (or device, doesn't matter) I get the error:
[error][tid:com.facebook.React.RCTExceptionsManagerQueue] Unhandled JS Exception: babelHelpers.interopRequireDefault is not a function. (In 'babelHelpers.interopRequireDefault(_reactNative)', 'babelHelpers.interopRequireDefault' is undefined)
I've just about run out of ideas here. Is there something I need to add to my xcode project maybe? Merging the latest react-native templates into mine was a nightmare so maybe something got messed up there.
This problem is discussed in this Github issue and fixed by this commit. You can apply this patch temporarily until it is merged into the project with the version 0.16.