首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >webpack tns在未定义的“onNavigatingTo”中运行android -bundle失败。

webpack tns在未定义的“onNavigatingTo”中运行android -bundle失败。
EN

Stack Overflow用户
提问于 2018-11-23 20:33:27
回答 1查看 179关注 0票数 0

当我使用tns run android运行时,我的应用程序运行得很好,但是当我使用tns run android --bundle时,它给了我exception.Following是一个堆栈跟踪:

代码语言:javascript
复制
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

代码语言:javascript
复制
{
  "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上找到。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-01-26 22:05:08

Nativescript webpack静态地分析了所有需要加载的组件并简化了这一过程,这就是为什么每一页都必须以“页面”结尾的原因。更多细节可以在https://github.com/NativeScript/nativescript-dev-webpack/issues/775上找到。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53452664

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档