react-native
react-native copied to clipboard
Error on reload: ERROR Invariant Violation: Failed to call into JavaScript module method RCTEventEmitter.receiveEvent()..
Description
if you reload the application from the simulator (using the hot button), we get the following error, if you reload the application from the metro bundler, then there is no such error
ERROR Invariant Violation: Failed to call into JavaScript module method RCTEventEmitter.receiveEvent(). Module has not been registered as callable. Bridgeless Mode: false. Registered callable JavaScript modules (n = 10): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, HMRClient, AppRegistry. A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native., js engine: hermes
Steps to reproduce
if you reload the application from the simulator (using the hot button), we get the following error, if you reload the application from the metro bundler, then there is no such error
React Native Version
0.73.2
Affected Platforms
Runtime - iOS
Areas
Fabric - The New Renderer, TurboModule - The New Native Module System, JSI - Javascript Interface, Bridgeless - The New Initialization Flow, Codegen
Output of npx react-native info
System:
OS: macOS 14.2.1
CPU: (12) arm64 Apple M3 Pro
Memory: 104.56 MB / 18.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 18.19.0
path: ~/.nvm/versions/node/v18.19.0/bin/node
Yarn:
version: 1.22.21
path: /opt/homebrew/bin/yarn
npm:
version: 10.2.3
path: ~/.nvm/versions/node/v18.19.0/bin/npm
Watchman:
version: 2023.12.04.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.14.3
path: /Users/skinnynpale/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 23.2
- iOS 17.2
- macOS 14.2
- tvOS 17.2
- visionOS 1.0
- watchOS 10.2
Android SDK: Not Found
IDEs:
Android Studio: 2023.1 AI-231.9392.1.2311.11076708
Xcode:
version: 15.2/15C500b
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.9
path: /usr/bin/javac
Ruby:
version: 3.0.6
path: /Users/skinnynpale/.rbenv/shims/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.73.2
wanted: 0.73.2
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: true
iOS:
hermesEnabled: true
newArchEnabled: false
Stacktrace or Logs
ERROR Invariant Violation: Failed to call into JavaScript module method RCTEventEmitter.receiveEvent(). Module has not been registered as callable. Bridgeless Mode: false. Registered callable JavaScript modules (n = 10): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, HMRClient, AppRegistry. A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native., js engine: hermes
Reproducer
--
Screenshots and Videos
:warning: | Missing Reproducible Example |
---|---|
:information_source: | We could not detect a reproducible example in your issue report. Please provide either:
|
if you reload the application from the simulator (using the hot button)
What do you mean with the "hot button" in the simulator?
if you reload the application from the simulator (using the hot button)
What do you mean with the "hot button" in the simulator?
when I press "R" while in the application, the metro bundler reload is triggered
I've tested this on RN Tester, and the problem doesn't happen. @skinnynpale are you able to create a reproducer of any sort? I suppose this could be related to some 3rd party library you have included.
I've tested this on RN Tester, and the problem doesn't happen. @skinnynpale are you able to create a reproducer of any sort? I suppose this could be related to some 3rd party library you have included.
Okay, thank you! I'll try
@skinnynpale, are you running into this issue in Bridgeless mode?
Fabric - The New Renderer, TurboModule - The New Native Module System, JSI - Javascript Interface, Bridgeless - The New Initialization Flow, Codegen
This code should never run in Bridgeless mode! I think you've stumbled onto an interesting bug. Looking forward to the reproducer!
@skinnynpale, are you running into this issue in Bridgeless mode?
Fabric - The New Renderer, TurboModule - The New Native Module System, JSI - Javascript Interface, Bridgeless - The New Initialization Flow, Codegen
This code should never run in Bridgeless mode! I think you've stumbled onto an interesting bug. Looking forward to the reproducer!
Research has shown that this error is triggered by createStackNavigator. We are thinking about switching to a native stack.
@skinnynpale, are you running into this issue in Bridgeless mode?
Fabric - The New Renderer, TurboModule - The New Native Module System, JSI - Javascript Interface, Bridgeless - The New Initialization Flow, Codegen
This code should never run in Bridgeless mode! I think you've stumbled onto an interesting bug. Looking forward to the reproducer!
I'm sorry, we don't have Bridgeless enabled, I thought it was enabled by default in the new architecture
we don't have Bridgeless enabled, I thought it was enabled by default in the new architecture
Nope it needs to be enabled separately in 0.73 @skinnynpale are you able to create a repro in any form?
we don't have Bridgeless enabled, I thought it was enabled by default in the new architecture
Nope it needs to be enabled separately in 0.73 @skinnynpale are you able to create a repro in any form?
@cortinico it caused by the react-native-screens with @react-navigation/bottom-tabs,
you can reproduce this issue with below repro. (when you trigger the "reload" inside app, the error happen, but NOT from terminal
https://github.com/sbin1211/RNInvariantViolation.git
it caused by the react-native-screens with @react-navigation/bottom-tabs,
Great, can we open an issue against react-native-screens
and link it here?
it caused by the react-native-screens with @react-navigation/bottom-tabs,
Great, can we open an issue against
react-native-screens
and link it here?
sure. @cortinico please help to link it. i don't know which side (RN or RNScreens) cause this issue.
sure. @cortinico please help to link it.
Please create the issue there, and post it here afterwards
i'm seeing this on android in my production app logs. did anyone had a chance to fix the issue on their side by any chance? issue on native-screen closed with no solution either :/
i'm seeing this on android in my production app logs. did anyone had a chance to fix the issue on their side by any chance? issue on native-screen closed with no solution either :/
I'm having the same issue on ios whenever I open the expo menu in the app
Closing because of: https://github.com/software-mansion/react-native-screens/issues/2027#issuecomment-2010077331