TypeError:未定义不是一个对象(评估'_expoModulesCore.NativeModulesProxy.ExpoSplashScreen')
我在 React Native 中遇到了这个问题。一切都运行正常,直到我决定通过
yarn install
重新运行项目。
这是完整的错误
TypeError: undefined is not an object (evaluating '_expoModulesCore.NativeModulesProxy.ExpoSplashScreen') at node_modules\react-native\Libraries\LogBox\LogBox.js:148:8 in registerError at node_modules\react-native\Libraries\LogBox\LogBox.js:59:8 in errorImpl at node_modules\react-native\Libraries\LogBox\LogBox.js:33:4 in console.error at node_modules\expo\build\environment\react-native-logs.fx.js:27:4 in error at node_modules\react-native\Libraries\Core\ExceptionsManager.js:104:6 in reportException at node_modules\react-native\Libraries\Core\ExceptionsManager.js:171:19 in handleException at node_modules\react-native\Libraries\Core\setUpErrorHandling.js:24:6 in handleError at node_modules\expo-error-recovery\build\ErrorRecovery.fx.js:12:21 in ErrorUtils.setGlobalHandler$argument_0 at node_modules\regenerator-runtime\runtime.js:63:36 in tryCatch at node_modules\regenerator-runtime\runtime.js:294:29 in invoke at node_modules\regenerator-runtime\runtime.js:63:36 in tryCatch at node_modules\regenerator-runtime\runtime.js:155:27 in invoke at node_modules\regenerator-runtime\runtime.js:165:18 in PromiseImpl.resolve.then$argument_0 at node_modules\react-native\node_modules\promise\setimmediate\core.js:37:13 in tryCallOne at node_modules\react-native\node_modules\promise\setimmediate\core.js:123:24 in setImmediate$argument_0 at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:130:14 in _callTimer at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:181:14 in _callImmediatesPass at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:441:30 in callImmediates at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:387:6 in __callImmediates at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:135:6 in __guard$argument_0 at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:364:10 in __guard at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:134:4 in flushedQueue
我尝试更新 expo-cli、expo-splash-screen 和缓存清除命令 expo r -c
如果有人可以帮忙,请告诉我。
您可以显示日志警告吗?因为我有同样的问题并已解决。
日志:
- expo-app-loading - 预期版本:1.1.2 - 实际安装版本:1.3.0
- react-native-screens - 预期版本:~3.4.0 - 实际安装版本:3.10.1
我在我的包中使用了版本 1.1.2 和 3.4.0:
"react-native-screens": "^3.4.0"
到
"react-native-screens": "3.4.0"
"expo-app-loading": "^1.1.2"
到
"expo-app-loading": "1.1.2"
删除您的 node_modules、yarn.lock 和package-lock.json
Yarn install
# or
npm install
对我来说已经解决了。
我在使用 expo-web-browser 时遇到了问题。因此,只需在终端上使用以下命令清除缓存即可。您将不会再看到上述错误:
expo r -c