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

Unexpected value 'QRCodeModule' imported by the module 'AppModule'

我正在尝试在我的离子应用程序中使用 https://www.npmjs.com/package/angular2-qrcode。 这是一个使用 ionic angular 2.0.0-rc.0

的 ionic2 应用程序

当我使用 ionic serve 时一切正常 但是,当我执行离子 运行 时,我得到

[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编译的完整日志?为了检查之前是否有错误。

这是我的应用程序模块:

...
...

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

],

有关 swing 模块运行良好的信息:) 在我的 package.json 中,我有 "angular2-qrcode": "^1.0.4",

提前感谢您的想法

祝你有愉快的一天:)

所以终于让它工作了,但它有点糟糕。

必须将 angular2-qrcode.ts 复制粘贴到我的本地存储库中(我从 https://github.com/SuperiorJT/angular2-qrcode/pull/4 中获取它)

完成后我必须修改导入

替换:

import * as qrcode from "qrcode-generator";

作者:

import qrcode from "qrcode-generator";

然后我安装了二维码生成器(npm install qrcode-generator --save)

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

此外,它是 MIT 许可证,因此我们可以根据需要复制和修改它:)

祝你好运,不要犹豫,投稿