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.
Related
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
Error is this
Error: Unable to resolve module metro/src/lib/bundle-modules/HMRClient
Here is additional error logs
This error appeared when I had to create a new project and ran react-native run-android just right after running react-native init PROJECT_NAME. Why I had to create another project is due to another error shown in this question.
Now I can't seem to run any of my react-native applications due to these problems. I am thinking this is a cache problem or somethings? maybe unstable package versions.
I have also found this solution in GitHub threads and actually removed the error log, but keeps crashing my application in android emulator (android studio)
I have tried reinstalling react-native-cli, but still have this error.
The exact error I get when I start the app is bundling failed:
Error: Unable to resolve module react-is from
/Users/someguy/projects/third/some-app/node_modules/react-navigation/node_modules/react-native-tab-view/node_modules/prop-types/index.js:
Module does not exist in the module map
The strange this about this error is that it only occurs when if I add
android:usesCleartextTraffic="true"
inside the AndroidManifest.xml file. This is needed due to the upgrade to SDK28. If I build the app without
android:usesCleartextTraffic="true"
I am able to start and run the app normally, but the metro bundler does NOT run and I can't access the debugger.
Should I add react-is to my package.json or do I just use npm and install it locally?
Turns out that by installing react-is. Fixes the problem.
After having upgraded from 0.27.2 to 0.30 (I've even tried 0.31.0-rc.0), I get the following Error on my Android device (both simulator and my device):
java.util.concurrent.ExecutionException:
java.lang.RuntimeException:
ReferenceError: Can't find variable:
process (http://...&dev=false&hot=false&minify=false:2448)
See attachment.
Any idea why that could happen?
Thanks!
The answer is found here:
Got JS Exception: ReferenceError: Can't find variable: process
You simply have to update react to 15.2.1.
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