Closed NickIliev closed 6 years ago
From @davecoffin on November 15, 2017 19:36
This is where the exception is being thrown:
function createRootView(v) {
var rootView = v;
var frame;
var main;
if (!rootView) {
main = mainEntry;
if (main) {
frame = new frame_1.Frame();
frame.navigate(main);
}
else {
throw new Error("A Frame must be used to navigate to a Page.");
}
rootView = frame;
}
return rootView;
}
thats from platforms/ios/myappname/vendor.js.
I've created a blank project with my EXACT package.json and it bundles and starts fine, so it doesnt appear to be any of my plugins.
@davecoffin have you resolved this issue? try bundling the application with the latest NativeScript 3.4.0 as done here.
Closing this one due to inactivity but do let me know if you are still experiencing this issue.
It does indeed solve this issue, thanks for checking in and thanks for all your hard work!! ❤️❤️❤️
I still have this issue, for iOS webpack build only (I didn't try on Android)
I've switch from nativescript-webpack 0.8.0 to 0.9.0, and follow explanation to the letter here
But when I run tns run ios --bundle
, then I get this error right after app starting :
JS ERROR Error: A Frame must be used to navigate to a Page
When I launch tns run ios
, it works correctly
tns info :
┌──────────────────┬─────────────────┬────────────────┬──────────────────┐
│ Component │ Current version │ Latest version │ Information │
│ nativescript │ 3.4.1 │ 3.4.1 │ Up to date │
│ tns-core-modules │ 3.4.0 │ 3.4.0 │ Up to date │
│ tns-android │ 3.3.1 │ 3.4.1 │ Update available │
│ tns-ios │ 3.4.1 │ 3.4.1 │ Up to date │
└──────────────────┴─────────────────┴────────────────┴──────────────────┘
Here is my webpack.config.js :
{
"description": "My Application desc",
"license": "My app name",
"readme": "NativeScript Application",
"repository": "<fill-your-repository-here>",
"nativescript": {
"id": "org.nativescript.myAppName",
"tns-android": {
"version": "3.3.1"
},
"tns-ios": {
"version": "3.4.1"
}
},
"dependencies": {
"@angular/animations": "~5.0.0",
"@angular/common": "~5.0.0",
"@angular/compiler": "~5.0.0",
"@angular/core": "~5.0.0",
"@angular/forms": "~5.0.0",
"@angular/http": "~5.0.0",
"@angular/platform-browser": "~5.0.0",
"@angular/platform-browser-dynamic": "~5.0.0",
"@angular/router": "~5.0.0",
"nativescript-angular": "^5.0.0",
"nativescript-bluetooth": "^1.1.6",
"nativescript-clipboard": "^1.1.7",
"nativescript-drop-down": "^3.1.1",
"nativescript-exit": "^1.0.1",
"nativescript-gcloud": "file:../plugins/nativescript-gcloud",
"nativescript-iqkeyboardmanager": "^1.1.0",
"nativescript-loading-indicator": "^2.3.2",
"nativescript-permissions": "^1.2.3",
"nativescript-plugin-firebase": "^5.0.2",
"nativescript-pro-ui": "^3.3.0",
"nativescript-texttospeech": "^1.3.2",
"nativescript-theme-core": "~1.0.2",
"nativescript-vibrate": "^2.0.1",
"ng2-translate": "^5.0.0",
"reflect-metadata": "~0.1.8",
"rxjs": "^5.5.0",
"tns-core-modules": "^3.4.0",
"zone.js": "~0.8.2"
},
"devDependencies": {
"@angular/compiler-cli": "~5.0.0",
"@ngtools/webpack": "~1.8.2",
"babel-traverse": "6.4.5",
"babel-types": "6.4.5",
"babylon": "6.4.5",
"copy-webpack-plugin": "~4.0.1",
"css-loader": "~0.28.7",
"extract-text-webpack-plugin": "~3.0.0",
"lazy": "1.0.11",
"nativescript-css-loader": "~0.26.0",
"nativescript-dev-sass": "^1.3.5",
"nativescript-dev-typescript": "^0.6.0",
"nativescript-dev-webpack": "^0.9.0",
"nativescript-worker-loader": "~0.8.1",
"raw-loader": "~0.5.1",
"resolve-url-loader": "~2.1.0",
"sass-loader": "~6.0.6",
"tns-platform-declarations": "^3.2.0",
"typescript": "~2.4.2",
"webpack": "~3.8.1",
"webpack-bundle-analyzer": "^2.8.2",
"webpack-sources": "~1.0.1"
}
}
From @davecoffin on November 15, 2017 15:51
When trying to start a webpack bundle using
npm run start-ios-bundle
, the bundling works, but when the application starts it crashes immediately with this:A Frame must be used to navigate to a Page.
Full log:
This may not be related, but when I try to
tns run ios
i get this error:error TS2307: Cannot find module './app.module.ngfactory'.
Here are the contents of the file, and btw the line importing app.module.ngfactory is red in vscode, it cannot find the module.
If I comment out the contents of that file, the apps starts fine using
tns run ios
.Here is my package.json:
Here is my tscongif.aot.json
Ive added all my lazy loaded modules into the
files
array based on instruction in @NathanWalker 's book. This./app/app.module.ts
is not lazy loaded, but i thought it might fix the problem related toerror TS2307: Cannot find module './app.module.ngfactory'.
but it doesnt.At this point no matter what I try, I keep getting the error
"A Frame must be used to navigate to a Page."
.Copied from original issue: NativeScript/NativeScript#5073