angular-seed-advanced + breeze + ios / android =无法找到模块' breeze-client'

时间:2017-06-09 08:01:51

标签: breeze nativescript

我试图使用微风的TempHire Angular参考项目将微风融入棱角种子 - 高级(https://github.com/NathanWalker/angular-seed-advanced):( https://github.com/Breeze/temphire.angular)。一切顺利,直到我在Android设备上运行应用程序。我在运行时遇到此错误(iOS模拟器给出了类似的结果):

An uncaught Exception occurred on "main" thread.
java.lang.RuntimeException: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: 

Error calling module function 

Error calling module function 

Error calling module function 

Error calling module function 

Error calling module function 

Error: com.tns.NativeScriptException: Failed to find module: "breeze-client", relative to: app/tns_modules/
    com.tns.Module.resolvePathHelper(Module.java:146)
    com.tns.Module.resolvePath(Module.java:55)
    com.tns.Runtime.runModule(Native Method)
    com.tns.Runtime.runModule(Runtime.java:504)
    com.tns.Runtime.run(Runtime.java:499)
    com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:17)
    android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1024)
    android.app.ActivityThread.handleBindApplication(ActivityThread.java:5405)
    android.app.ActivityThread.-wrap2(ActivityThread.java)
    android.app.ActivityThread$H.handleMessage(ActivityThread.java:1546)
    android.os.Handler.dispatchMessage(Handler.java:102)
    android.os.Looper.loop(Looper.java:154)
    android.app.ActivityThread.main(ActivityThread.java:6121)
    java.lang.reflect.Method.invoke(Native Method)
    com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
    com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
File: "<unknown>, line: 1, column: 265

StackTrace: 
    Frame: function:'require', file:'', line: 1, column: 266
    Frame: function:'', file:'file:///data/data/com.yourdomain.nativescript/files/app/app/modules/core/services/entity-manager-provider.js', line: 3, column: 23
    Frame: function:'require', file:'', line: 1, column: 266
    Frame: function:'', file:'file:///data/data/com.yourdomain.nativescript/files/app/app/modules/core/services/index.js', line: 14, column: 33
    Frame: function:'require', file:'', line: 1, column: 266
    Frame: function:'', file:'file:///data/data/com.yourdomain.nativescript/files/app/app/modules/core/index.js', line: 6, column: 10
    Frame: function:'require', file:'', line: 1, column: 266
    Frame: function:'', file:'file:///data/data/com.yourdomain.nativescript/files/app/native.module.js', line: 11, column: 15
    Frame: function:'require', file:'', line: 1, column: 266
    Frame: function:'', file:'file:///data/data/com.yourdomain.nativescript/files/app/app.js', line: 5, column: 23
    Frame: function:'require', file:'', line: 1, column: 266

我认为这是nativescript的Webpack配置问题。因为首先,编译成功了。所以编译器可以找到&#39; breeze-client&#39;模块没有问题。其次,该应用程序在使用systemjs的Web浏览器中运行良好。但是systemjs使用不同的配置文件。我不熟悉WebPack配置文件。

修改 我想我找到了问题的所在,但仍然不知道如何解决它:

tns build android期间,node_modules\*被复制到tns_modules\*,这将在移动应用中使用。但是,在构建过程中,breeze.debug.js等文件会重命名为breeze.js.debug已删除)。稍后当App运行时,CommonJS会尝试加载breeze.client模块。它会检查package.json下的tns_modules\breeze-client文件以查看"main": "./breeze.debug.js",但该文件不存在。

我想知道是否存在某个配置,以防止在构建过程中将breeze.debug.js重命名为breeze.js

感谢任何帮助。

1 个答案:

答案 0 :(得分:0)

我不太熟悉angular-seed,但看起来就像你需要将breeze-client添加到WWDC Session 710 Video "Core ML In Depth"中的APP_ASSETS数组。< / p>

然后它应该在模块中包含breeze库。