react-native-screens
react-native-screens copied to clipboard
Error on reload: ERROR Invariant Violation: Failed to call into JavaScript module method RCTEventEmitter.receiveEvent
Description
some users report this issue, and i think it's caused by the React-Native-screens.
https://github.com/facebook/react-native/issues/42640#issue-2098722178
Steps to reproduce
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
Snack or a link to a repository
https://github.com/sbin1211/RNInvariantViolation.git
Screens version
3.29
React Native version
0.73
Platforms
iOS
JavaScript runtime
Hermes
Workflow
React Native (without Expo)
Architecture
Fabric (New Architecture)
Build type
None
Device
None
Device model
No response
Acknowledgements
Yes
Hi @sbin1211, thanks for creating this issue! Unfortunately I cannot reproduce the error with given steps to repro 😕 Could you give us more details about the device you're using where this error happens?
https://github.com/software-mansion/react-native-screens/assets/23281839/e9fc8b3f-b9d8-4ded-b17a-400680603559
Hi @sbin1211, thanks for creating this issue! Unfortunately I cannot reproduce the error with given steps to repro 😕 Could you give us more details about the device you're using where this error happens?
8mb.video-riQ-fSVsSIX3.mp4
https://github.com/software-mansion/react-native-screens/assets/22540308/77f22c09-e974-4c9f-8890-f4fd3eff213e
@tboba see the screencast, it happens when fabirc turn on and enableScreens(true); but when you change code to enableScreens(false) , the error disappear.
"AwesomeProject" with {"rootTag":1,"initialProps":{"concurrentRoot":true},"fabric":true}
Hi @sbin1211, sorry for the delay 🙏 I still can't reproduce the bug, even if I enabled fabric. Have you tried to reset cache of yarn/npm before running your app? Are you listening for some events?
Also, please take a note that with the newer version of react-native-screens, we will start to use other method for sending events to JS. Could you check if this bug still exists with the version of screens, taken from branch? You just need to change the version from package.json to:
"react-native-screens": "software-mansion/react-native-screens#main"