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.
Exactly same happens with JavaScript too. When any value is assigned to undeclared variable or assignment without the var keyword or variable is not in your current scope, it might lead to unexpected results and that’s why JavaScript presents a ReferenceError: assignment to undeclared variable "x" in strict mode.
This JavaScript exception variable is not defined occurs if there is a non-existent variable that is referenced somewhere. There is a non-existent variable that is referenced somewhere in the script. That variable has to be declared, or make sure the variable is available in the current script or scope.
Likewise there are many scripting factors possible to generate reference error in javascript. Saif Sadiq is a Product Growth specialist at LambdaTest and Growth Marketer. Saif Sadiq is a Product Growth specialist at LambdaTest.
There is a non-existent variable that is referenced somewhere in the script. That variable has to be declared, or make sure the variable is available in the current script or scope. Example 1: In this example, the variable (val1) is being accessed from the outside of the function, So the error has not occurred.
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 [email protected] --save
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With