mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00
refactor(): add better err msg for missing main entry (#7063)
This commit is contained in:
@ -273,16 +273,15 @@ function createRootView(v?: View) {
|
||||
let rootView = v;
|
||||
if (!rootView) {
|
||||
// try to navigate to the mainEntry (if specified)
|
||||
if (mainEntry) {
|
||||
if (!mainEntry) {
|
||||
throw new Error("Main entry is missing. App cannot be started. Verify app bootstrap.");
|
||||
} else {
|
||||
if (createRootFrame.value) {
|
||||
const frame = rootView = new Frame();
|
||||
frame.navigate(mainEntry);
|
||||
} else {
|
||||
rootView = createViewFromEntry(mainEntry);
|
||||
}
|
||||
} else {
|
||||
// TODO: Throw an exception?
|
||||
throw new Error("A Frame must be used to navigate to a Page.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1171,6 +1171,10 @@ class ActivityCallbacksImplementation implements AndroidActivityCallbacks {
|
||||
|
||||
if (!rootView) {
|
||||
const mainEntry = application.getMainEntry();
|
||||
if (!mainEntry) {
|
||||
throw new Error("Main entry is missing. App cannot be started. Verify app bootstrap.");
|
||||
}
|
||||
|
||||
const intent = activity.getIntent();
|
||||
|
||||
if (fireLaunchEvent) {
|
||||
|
Reference in New Issue
Block a user