@@ -190,13 +190,24 @@ const AppRegistry = {
190
190
( ) => msg ,
191
191
) ;
192
192
}
193
- invariant (
194
- runnables [ appKey ] && runnables [ appKey ] . run ,
195
- `"${appKey}" has not been registered . This can happen if :\n` +
196
- '* Metro (the local dev server) is run from the wrong folder. ' +
197
- 'Check if Metro is running, stop it and restart it in the current project.\n' +
198
- "* A module failed to load due to an error and ` AppRegistry . registerComponent ` wasn't called.",
199
- );
193
+
194
+ // NOTE(brentvatne): the original error message here, commented out below,
195
+ // is not useful to developers in the Expo managed workflow. It also will
196
+ // prevent any red box error that has occurred while loading the bundle from
197
+ // being visible to the user. So, we instead warn and give a more tailored
198
+ // message to help users with debugging the issue.
199
+ if ( ! runnables [ appKey ] || ! runnables [ appKey ] . run ) {
200
+ console . warn ( `Unable to start your application. Please refer to https://expo.fyi/no-registered-application for more information.` ) ;
201
+ return ;
202
+ }
203
+
204
+ // invariant(
205
+ // runnables[appKey] && runnables[appKey].run,
206
+ // `"${appKey}" has not been registered. This can happen if:\n` +
207
+ // '* Metro (the local dev server) is run from the wrong folder. ' +
208
+ // 'Check if Metro is running, stop it and restart it in the current project.\n' +
209
+ // "* A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called.",
210
+ // );
200
211
201
212
SceneTracker . setActiveScene ( { name : appKey } ) ;
202
213
runnables [ appKey ] . run ( appParameters ) ;
0 commit comments