react-native-code-push icon indicating copy to clipboard operation
react-native-code-push copied to clipboard

RCTCallableJSModules is not set. This is probably because you've explicitly synthesized the RCTCallableJSModules in CodePush, even though it's inherited from RCTEventEmitter

Open khushbujilka22 opened this issue 2 years ago • 11 comments

Thanks so much for filing an issue or feature request! Please fill out the following (wherever relevant):

while downloading the code push update, it suddenly crashed with an exception.

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Error when sending event: CodePushDownloadProgress with body: {
    receivedBytes = 1874408;
    totalBytes = 1874408;
}. RCTCallableJSModules is not set. This is probably because you've explicitly synthesized the RCTCallableJSModules in CodePush, even though it's inherited from RCTEventEmitter.'
*** First throw call stack:
(0x180a27c80 0x19824dee4 0x1821cdde0 0x1047a1508 0x1041d6c88 0x1041d8a3c 0x1041dbb68 0x1044c4ae4 0x1044bff6c 0x1044c4944 0x1813d3bb0 0x1820f739c 0x182108a70 0x1820e2a8c 0x1820f2fcc 0x1820f6498 0x182103ccc 0x10851d1a8 0x10850dfc8 0x108515150 0x108515ddc 0x10852163c 0x1dbd94e00 0x1dbd9492c)
libc++abi: terminating with uncaught exception of type NSException`

Environment

  • "react-native": "0.72.3",
  • "react-native-code-push": "8.1.0"

This is happening with IOS in release and debug build both.

khushbujilka22 avatar Oct 17 '23 04:10 khushbujilka22

@khushbujilka22 , thanks for reaching out!

Does this issue happen every time, or just sometimes? Also, could you make a simple demo app that shows the problem?

There's a similar issue you might find relevant: https://github.com/microsoft/react-native-code-push/issues/2133

DmitriyKirakosyan avatar Oct 31 '23 16:10 DmitriyKirakosyan

happening to me as well

griffinbaker12 avatar Nov 10 '23 07:11 griffinbaker12

I'm facing the exactly same issue. Every updates are rolled back after downloaded. Any fix?

mununki avatar Dec 27 '23 06:12 mununki

For me, I used a variable "hasListeners" to track whether the RN side has been initialized with listeners set up, along with the start and stopObserving methods that I override on the RCTEventEmitter. If this is true, then I allow events to be sent (you can send all events through one method). I use a guard statement within that function. Hope this helps!

griffinbaker12 avatar Dec 27 '23 14:12 griffinbaker12

For me, I used a variable "hasListeners" to track whether the RN side has been initialized with listeners set up, along with the start and stopObserving methods that I override on the RCTEventEmitter. If this is true, then I allow events to be sent (you can send all events through one method). I use a guard statement within that function. Hope this helps!

Can you share the code to patch? I'm new to objective-c and iOS development.

mununki avatar Dec 27 '23 14:12 mununki

@griffinbaker12 If I understand correctly, Is this what you mean by adding code to CodePush.m, like sending event to JavaScript's startObserving? https://reactnative.dev/docs/0.72/native-modules-ios#sending-events-to-javascript

mununki avatar Dec 27 '23 18:12 mununki

I used Swift in my example, but am happy to show you that if you still find it helpful.

griffinbaker12 avatar Dec 27 '23 20:12 griffinbaker12

I used Swift in my example, but am happy to show you that if you still find it helpful.

Even if you're Swift, I think it would be helpful to see how you adapted it.

mununki avatar Dec 28 '23 01:12 mununki

Hi guys @mununki, @griffinbaker12 did you found the solution? If not, could you please confirm what this issue still persist on latest version (8.2.1)?

MikhailSuendukov avatar Mar 07 '24 15:03 MikhailSuendukov

Mine was resolved https://github.com/microsoft/react-native-code-push/issues/2639

mununki avatar Mar 08 '24 02:03 mununki

This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs within 15 days of this comment.

This issue will now be closed because it hasn't had any activity for 15 days after stale. Please feel free to open a new issue if you still have a question/issue or suggestion.