webpack tns 运行 android --bundle 失败,'onNavigatingTo' 未定义
webpack tns run android --bundle fails with 'onNavigatingTo' of undefined
我的应用程序 运行 在我 运行 使用 tns run android
时很好,但是当我使用 tns run android --bundle
时它给我 exception.Following 是一个堆栈跟踪:
System.err: com.tns.NativeScriptException:
System.err: Calling js method onViewAttachedToWindow failed
System.err: TypeError: Cannot read property 'onNavigatingTo' of undefined
System.err: File: "file:///data/data/com.travel/files/app/vendor.js, line: 32768, column: 36
System.err: StackTrace:
System.err: Frame: function:'push.../node_modules/tns-core-modules/ui/frame/frame-common.js.FrameBase._onNavigatingTo', file:'file:///data/data/co
m.travel/files/app/vendor.js', line: 32768, column: 37
System.err: Frame: function:'push.../node_modules/tns-core-modules/ui/frame/frame-common.js.FrameBase.performNavigation', file:'file:///data/data/
com.travel/files/app/vendor.js', line: 32740, column: 14
System.err: Frame: function:'push.../node_modules/tns-core-modules/ui/frame/frame-common.js.FrameBase._processNextNavigationEntry', file:'file:///
data/data/com.travel/files/app/vendor.js', line: 32733, column: 22
System.err: Frame: function:'push.../node_modules/tns-core-modules/ui/frame/frame.js.Frame._processNextNavigationEntry', file:'file:///data/data/c
om.travel/files/app/vendor.js', line: 33206, column: 58
System.err: Frame: function:'push.../node_modules/tns-core-modules/ui/frame/frame.js.Frame._onAttachedToWindow', file:'file:///data/data/com.trav
el/files/app/vendor.js', line: 33181, column: 14
System.err: Frame: function:'AttachListener.onViewAttachedToWindow', file:'file:///data/data/com.travel/files/app/vendor.js', line: 33
098, column: 27
System.err: at com.tns.Runtime.callJSMethodNative(Native Method)
以下是我的package.json
{
"nativescript": {
"id": "com.travel",
},
"scripts": {
"lint": "tslint \"app/**/*.ts\""
},
"dependencies": {
"nativescript-appversion": "^1.4.1",
"nativescript-grid-view": "^4.1.1",
"nativescript-purchase": "^2.0.5",
"nativescript-social-share": "^1.5.1",
"nativescript-theme-core": "~1.0.4",
"nativescript-toast": "^1.4.6",
"nativescript-ui-chart": "^3.9.1",
"nativescript-ui-sidedrawer": "~5.0.0",
"rxjs": "~6.2.0",
"tns-core-modules": "~5.0.0"
},
"devDependencies": {
"nativescript-dev-sass": "~1.6.0",
"nativescript-dev-typescript": "~0.7.0",
"nativescript-dev-webpack": "^0.18.0",
"tns-platform-declarations": "^5.0.2",
"tslint": "~5.11.0",
"typescript": "~2.7.2"
}
}
有人可以指导我这里有什么问题吗?完整的源代码可以在 https://github.com/rakeshgirase/NSWebpack
找到
Nativescript webpack 静态分析所有需要加载的组件并简化此过程,这就是每个页面必须以 "page" 结尾的原因。可以在 https://github.com/NativeScript/nativescript-dev-webpack/issues/775 找到更多详细信息。
我的应用程序 运行 在我 运行 使用 tns run android
时很好,但是当我使用 tns run android --bundle
时它给我 exception.Following 是一个堆栈跟踪:
System.err: com.tns.NativeScriptException:
System.err: Calling js method onViewAttachedToWindow failed
System.err: TypeError: Cannot read property 'onNavigatingTo' of undefined
System.err: File: "file:///data/data/com.travel/files/app/vendor.js, line: 32768, column: 36
System.err: StackTrace:
System.err: Frame: function:'push.../node_modules/tns-core-modules/ui/frame/frame-common.js.FrameBase._onNavigatingTo', file:'file:///data/data/co
m.travel/files/app/vendor.js', line: 32768, column: 37
System.err: Frame: function:'push.../node_modules/tns-core-modules/ui/frame/frame-common.js.FrameBase.performNavigation', file:'file:///data/data/
com.travel/files/app/vendor.js', line: 32740, column: 14
System.err: Frame: function:'push.../node_modules/tns-core-modules/ui/frame/frame-common.js.FrameBase._processNextNavigationEntry', file:'file:///
data/data/com.travel/files/app/vendor.js', line: 32733, column: 22
System.err: Frame: function:'push.../node_modules/tns-core-modules/ui/frame/frame.js.Frame._processNextNavigationEntry', file:'file:///data/data/c
om.travel/files/app/vendor.js', line: 33206, column: 58
System.err: Frame: function:'push.../node_modules/tns-core-modules/ui/frame/frame.js.Frame._onAttachedToWindow', file:'file:///data/data/com.trav
el/files/app/vendor.js', line: 33181, column: 14
System.err: Frame: function:'AttachListener.onViewAttachedToWindow', file:'file:///data/data/com.travel/files/app/vendor.js', line: 33
098, column: 27
System.err: at com.tns.Runtime.callJSMethodNative(Native Method)
以下是我的package.json
{
"nativescript": {
"id": "com.travel",
},
"scripts": {
"lint": "tslint \"app/**/*.ts\""
},
"dependencies": {
"nativescript-appversion": "^1.4.1",
"nativescript-grid-view": "^4.1.1",
"nativescript-purchase": "^2.0.5",
"nativescript-social-share": "^1.5.1",
"nativescript-theme-core": "~1.0.4",
"nativescript-toast": "^1.4.6",
"nativescript-ui-chart": "^3.9.1",
"nativescript-ui-sidedrawer": "~5.0.0",
"rxjs": "~6.2.0",
"tns-core-modules": "~5.0.0"
},
"devDependencies": {
"nativescript-dev-sass": "~1.6.0",
"nativescript-dev-typescript": "~0.7.0",
"nativescript-dev-webpack": "^0.18.0",
"tns-platform-declarations": "^5.0.2",
"tslint": "~5.11.0",
"typescript": "~2.7.2"
}
}
有人可以指导我这里有什么问题吗?完整的源代码可以在 https://github.com/rakeshgirase/NSWebpack
找到Nativescript webpack 静态分析所有需要加载的组件并简化此过程,这就是每个页面必须以 "page" 结尾的原因。可以在 https://github.com/NativeScript/nativescript-dev-webpack/issues/775 找到更多详细信息。