我们收到元数据错误,这会妨碍我们的部署。由于它不允许ng构建。下面是配置;然后是完整的错误跟踪。
ERROR in Error: Metadata version mismatch for module <Angular4.3-AppPath>/node_modules/angular2-qrscanner/angular2-qrscanner.d.ts, found version 4, expected 3, resolving symbol <Module_Name>in <Angular4.3-AppPath>/src/app/modules/manage/device/device.module.ts, resolving symbol <Module_Name>in <Angular4.3-AppPath>/src/app/<Module_Path>.ts
at syntaxError (<Angular4.3-AppPath>\node_modules@angular\compiler\bundles\compiler.umd.js:1725:34)
at simplifyInContext (<Angular4.3-AppPath>\node_modules@angular\compiler\bundles\compiler.umd.js:24953:23)
at StaticReflector.simplify (<Angular4.3-AppPath>\node_modules@angular\compiler\bundles\compiler.umd.js:24965:13)
at StaticReflector.annotations (<Angular4.3-AppPath>\node_modules@angular\compiler\bundles\compiler.umd.js:24395:41)
at _getNgModuleMetadata (<Angular4.3-AppPath>\node_modules@angular\compiler-cli\src\ngtools_impl.js:138:31)
at _extractLazyRoutesFromStaticModule (<Angular4.3-AppPath>\node_modules@angular\compiler-cli\src\ngtools_impl.js:109:26)
at <Angular4.3-AppPath>\node_modules@angular\compiler-cli\src\ngtools_impl.js:129:27
at Array.reduce ()
at _extractLazyRoutesFromStaticModule (<Angular4.3-AppPath>\node_modules@angular\compiler-cli\src\ngtools_impl.js:128:10)
at Object.listLazyRoutesOfModule (<Angular4.3-AppPath>\node_modules@angular\compiler-cli\src\ngtools_impl.js:53:22)
at Function.NgTools_InternalApi_NG_2.listLazyRoutes (<Angular4.3-AppPath>\node_modules@angular\compiler-cli\src\ngtools_api.js:91:39)
at AotPlugin._getLazyRoutesFromNgtools (<Angular4.3-AppPath>\node_modules@ngtools\webpack\src\plugin.js:241:66)
at _donePromise.Promise.resolve.then.then.then.then.then (<Angular4.3-AppPath>\node_modules@ngtools\webpack\src\plugin.js:495:24)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
webpack:无法编译。
setting:angular2-qrscanner版本:1.0.7 Angular CLI:1.5.0节点:8.10.0操作系统:win32 x64 Angular:4.3.2 ... common,compiler,compiler-cli,core,forms,http。 ..平台浏览器,平台浏览器动态,路由器@角度/动画:4.4.0-RC.0 @角度/ cdk:2.0.0-beta.10 @角度/ cli:1.5.0 @角度/ flex-布局:2.0.0-beta.8 @ angular /材质:2.0.0-beta.10 @ angular-devkit / build-optimizer:0.0.33 @ angular-devkit / core:0.0.20 @ angular-devkit / schematics: 0.0.35 @ ngtools / json-schema:1.1.0 @ ngtools / webpack:1.8.0 @ schematics / angular:0.1.3打字稿:2.6.1 webpack:3.8.1
答案 0 :(得分:0)
在localhost:4200中解决。不推荐使用该软件包,该软件包的名称为angular2-qrscanner@0.1.7。而且有效!
但是,在作为Azure WebApp托管时,相机拒绝加载。它在Chrome的控制台上显示错误消息,如下所示:-
拒绝从“ blob:/ 5c07044f-447c-45a9-979e-458d5e955f8f”加载媒体,因为它违反了以下内容安全策略指令:“ default-src'unsafe-inline'data:https:”。请注意,未明确设置“ media-src”,因此将“ default-src”用作备用。
解决方案致力于:- Edge和IE不会给出此错误。相机打开,但不扫描。我应该切换到另一个QR扫描仪还是继续“ angular2-qrscanner”。我正在考虑相同的情况。