You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

React Native Navigation与Yarn Workspace集成时应用崩溃问题排查求助

React Native Navigation Crashes When Integrated with Yarn Workspaces

I've run into a frustrating crash issue after adding React Native Navigation (RNN) to my React Native project that uses Yarn Workspaces. I tested multiple times both with and without Yarn Workspaces enabled, and confirmed the problem is directly tied to the Workspace configuration. I've also put together a reproduction project to help diagnose the issue.

Reproduction Steps

  • Initialize a React Native project
  • Set up a Yarn Workspace with 2 packages (check the package.json and metro.config.js in the reproduction project for details)
  • Run yarn add react-native-navigation in one of the packages
  • Execute npx rnn-link (all steps reported success)
  • Modify index.js to let RNN handle app initialization and configure a basic route
  • Run pod install
  • Launch the project via Xcode or yarn android

Expected Behavior

The app should launch and run normally on both Android and iOS platforms.

Actual Behavior

  • Android: Shows a black screen instead of the splash screen, then crashes after a few seconds with a flood of error logs
  • iOS: Crashes even faster, with core error logs matching Android's:
ERROR Invariant Violation: No callback found with cbID 0 and callID 0 for module <unknown>. Args: '[{"app_state":"active"}]'
ERROR Invariant Violation: No callback found with cbID 6 and callID 3 for module <unknown>. Args: '[{"app_state":"active"}]'
ERROR Invariant Violation: No callback found with cbID 60 and callID 30 for module <unknown>. Args: '["{\"codeFrame\":{\"content\":\"\\u001b[0m \\u001b[90m 36 |\\u001b[39m \\u001b[36mvar\\u001b[39m args \\u00...(truncated)..."}]'

(A large number of identical repeated errors follow these)
I also see this log line before the crash: LOG Running "com.myApp.WelcomeScreen" with {"initialProps":{"componentId":"Component1"},"rootTag":1}

Environment Details

  • React Native Navigation version: 7.14.0
  • React Native version: 0.64.0
  • Tested devices: Xiaomi Redmi Note 7, Android Emulator, Xcode Simulator

My hunch is that something's off with the Yarn Workspace configuration, but the setup works perfectly fine when RNN isn't integrated. Could anyone share some troubleshooting tips or potential fixes?

内容的提问来源于stack exchange,提问作者jeremy_kanso

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.29 17:22:50