得到 JS 异常:ReferenceError:找不到变量:进程 [英] Got JS Exception: ReferenceError: Can't find variable: process

查看:31
本文介绍了得到 JS 异常:ReferenceError:找不到变量:进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从 react-native 0.26 升级到 0.29(并运行 react-native upgrade)后,我在 android 调试器中收到以下错误:

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

Android模拟器中的这个错误信息

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 (...)

自升级以来我没有更改任何我的应用程序 javascript,并且之前一切运行都没有错误,所以我假设问题不在 javascript 中,而是 react 版本的更改删除了进程"变量?

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.

推荐答案

有同样的问题:

java.lang.RuntimeException: java.util.concurrent.ExecutionException:
java.lang.RuntimeException: ReferenceError: Can't find variable: process

通过将 React 升级到最新的兼容版本来修复,在我的例子中是 15.2.1:

Fixed by upgrading the React to the latest compatible version, 15.2.1 in my case:

npm i react@15.2.1 --save

这篇关于得到 JS 异常:ReferenceError:找不到变量:进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆