模块'AppModule'导入的意外值'QRCodeModule'

时间:2016-11-06 18:18:28

标签: angular ionic2 qr-code

我正在尝试在我的离子应用程序中使用https://www.npmjs.com/package/angular2-qrcode。 它是离子2应用,使用离子角2.0.0-rc.0

当我做离子服务时,一切都很完美 但是,当我进行离子运行时,我正在接受

[19:05:49]  ngc: Error: Unexpected value 'QRCodeModule' imported by the module 'AppModule'
at D:\jdevcc\git\pr\application\handyou-original\node_modules\@angular\compiler\bundles\compiler.umd.js:13982:37
at Array.forEach (native)
at CompileMetadataResolver.getNgModuleMetadata (D:\jdevcc\git\pr\application\handyou-original\node_modules\@angular\compiler\bundles\compiler.umd.js:13967:46)
at D:\jdevcc\git\pr\application\handyou-original\node_modules\@angular\compiler\bundles\compiler.umd.js:12812:58
at Array.forEach (native)
at OfflineCompiler.analyzeModules (D:\jdevcc\git\pr\application\handyou-original\node_modules\@angular\compiler\bundles\compiler.umd.js:12811:21)
at CodeGenerator.codegen (D:\jdevcc\git\pr\application\handyou-original\node_modules\@angular\compiler-cli\src\codegen.js:105:47)
at codegen (D:\jdevcc\git\pr\application\handyou-original\node_modules\@angular\compiler-cli\src\main.js:7:81)
at Object.main (D:\jdevcc\git\pr\application\handyou-original\node_modules\@angular\tsc-wrapped\src\main.js:30:16)
at Object.<anonymous> (D:\jdevcc\git\pr\application\handyou-original\node_modules\@angular\compiler-cli\src\main.js:14:9)

你有没有想法?

有没有办法获得ngc编译的完整日志?为了检查之前是否发生了错误。

这是我的app模块:

...
...

  imports: [QRCodeModule, SwingModule
IonicModule.forRoot(MyApp, {
  tabsHideOnSubPages : 'true'
})

],

有关摆动模块工作正常的信息:)在我的package.json中我有“angular2-qrcode”:“^ 1.0.4”,

提前感谢您的想法

度过愉快的一天:)

1 个答案:

答案 0 :(得分:0)

所以最终让它工作但它有点糟糕。

必须复制粘贴我本地存储库中的angular2-qrcode.ts(我从QTAssistant获取它)

完成后我必须修改导入

取代:

import * as qrcode from "qrcode-generator";

由:

import qrcode from "qrcode-generator";

然后我安装了qrcode-generator(npm install qrcode-generator --save)

我知道这不是最好的解决方案,但他们必须生成* metadata.json,目前还没有完成...

此外它是麻省理工学院的许可证,所以我们可以根据需要进行修改并修改它:)

祝你好运,不要犹豫不决

相关问题