When building a basic sample project for iOS, following the project in the playground folder, the app throws the following warning Sending 'RNN.appLaunched' with no listeners registered.
git clone [email protected]:kasperkronborg/test-navigation.gityarn installreact-native run-iosIn the github project I have added some log statements to the iOS Library, that gives the indication of a race condition. It seems that RNN.appLaunched are called to early, when there has still not been any listeners attached through Navigation.events().onAppLaunched().
Can't reproduce,
But discovered a bug in RN45 causing cmd+R to crash in navigation. Will open a separate issue.
I downloaded, and ran the test-project as mentioned above. The project launched at first, but I do as well get Sending 'RNN.appLaunched' with no listeners registered.. I then closed the simulator, packager and ran the project again. This time the project did not get pass the launch screen.
It does indeed smell of some kind of race condition.
To summarize the discussion in discord, it does not reproduce in RN44.
I also ran into this issue using RNN 2.0.1950 and RN 0.46.4 with a simple init script:
import Navigation from 'react-native-navigation';
import SampleScreen from './app/screens/sampleScreen';
Navigation.registerContainer('SampleScreen', () => SampleScreen);
Navigation.events().onAppLaunched(() => {
Navigation.setRoot({
container: {
name: 'SampleScreen'
}
});
});
@DanielZlotin what is the best way to deal with this? going back to RN 0.45.X or RN 0.44.X ?
Did anyone get any further with this - it still is a problem on 0.46.4, 0.47 and 2.0.1977
It seems as the others have mentioned a race condition since if I switch off remote debugging the no listeners message disappears.
@Paul-Todd I can confirm that having remote debugging on causes:
2017-09-09 01:56:39.618 [warn][tid:main][RCTEventEmitter.m:54] Sending RNN.appLaunched with no listeners registered.
and thus Navigation.events().onAppLaunched() is not being called.
@DanielZlotin Do you have any thoughts on this? I am trying out v2, and I can't use remote debugging because of this issue.
I am digging into it, and It seems RCTJavaScriptDidLoadNotification is called for each javascript bundle load, and enabling remote debugging or hmr causes separate js bundles to load other than the app bundle.
Enabling remote debugging causes its js bundle to load before app bundle (which makes sense cause you want to attach debugger before starting app) so that jsload event is raised before app successfully starts listening to applaunch event.
I think there must be a better way to start an app other than listening to RCTJavaScriptDidLoadNotification event because it can be false positive due the reasons above.
Or at least should be able to differentiate app bundle's RCTJavaScriptDidLoadNotification from that of other js bundles.
Created PR https://github.com/wix/react-native-navigation/pull/1816. Tested and it fixes the issue.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest version and report back. Thank you for your contributions.
The issue has been closed for inactivity.
On Jul 21, 2018 13:49, "stale[bot]" notifications@github.com wrote:
Closed #1397 https://github.com/wix/react-native-navigation/issues/1397.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/wix/react-native-navigation/issues/1397#event-1746057473,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACJPB4r0l4BdSFDM_Qvmi_NEeDqWUyMaks5uIxUUgaJpZM4OBPJH
.
Hi @joonhocho! 'm working on a brownfield app and I have the same problem. I would like to now if you can point me to the code you've used in the react-native-navigation project in order to fix the problem. I've downloaded the source code but I cannot find anymore that fix.
Right now I'm using RCTJavaScriptDidLoadNotification in order to know if the bundle has been loaded or not but I receive the errore described in this thread.
Thanks, Lorenzo
Any updates on this issue?
Most helpful comment
I am digging into it, and It seems
RCTJavaScriptDidLoadNotificationis called for each javascript bundle load, and enabling remote debugging or hmr causes separate js bundles to load other than the app bundle.Enabling remote debugging causes its js bundle to load before app bundle (which makes sense cause you want to attach debugger before starting app) so that jsload event is raised before app successfully starts listening to applaunch event.
I think there must be a better way to start an app other than listening to
RCTJavaScriptDidLoadNotificationevent because it can be false positive due the reasons above.Or at least should be able to differentiate app bundle's
RCTJavaScriptDidLoadNotificationfrom that of other js bundles.