react-native-screens icon indicating copy to clipboard operation
react-native-screens copied to clipboard

Error on reload: ERROR Invariant Violation: Failed to call into JavaScript module method RCTEventEmitter.receiveEvent

Open sbin1211 opened this issue 1 year ago • 3 comments

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

sbin1211 avatar Feb 04 '24 09:02 sbin1211

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

tboba avatar Feb 07 '24 14:02 tboba

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}

sbin1211 avatar Feb 17 '24 07:02 sbin1211

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"
image

tboba avatar Mar 20 '24 17:03 tboba