2016-11-06 67 views
0

我想在我的離子應用程序中使用https://www.npmjs.com/package/angular2-qrcode。 它使用離子角2.0.0 rc.0由模塊'AppModule'導入的意外值'QRCodeModule'

的ionic2應用程序時,我做的離子成爲一切完美 然而,當我做一個離子跑我得到

[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' 
}) 

],

的信息,搖擺模塊工作完美:)在我的package.json我有 「angular2-QR碼」:「^ 1.0。 4" ,

預先感謝您的想法

有一個愉快的一天:)

+0

你找到了一個解決方案?我有同樣的問題。 –

+0

我會把這個補充 – Geoffrey

回答

0

所以最後讓它工作,但它有點蹩腳。

不得不復制粘貼在我的本地庫的angular2-qrcode.ts(我把它從https://github.com/SuperiorJT/angular2-qrcode/pull/4

一旦它已經做了我不得不修改進口

取代:

import * as qrcode from "qrcode-generator"; 

由:

import qrcode from "qrcode-generator"; 

然後我安裝QRCode的-克enerator(NPM安裝QRCode的發電機--save)

我知道這是不是最好的解決辦法,但他們必須生產* metadata.json和尚未完成目前...

此外,它是MIT許可,所以我們可以coppy它,修改它,因爲我們希望:)

祝你好運,不要猶豫,把多達

相關問題