-1

我们收到阻碍我们部署的元数据错误。因为它不允许 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:编译失败。

设置: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 ...平台-浏览器,平台浏览器动态,路由器@angular/animations:4.4.0-RC.0 @angular/cdk:2.0.0-beta.10 @angular/cli:1.5.0 @angular/flex-layout:2.0 .0-beta.8 @angular/material: 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 @schemics/angular: 0.1.3 typescript: 2.6.1 webpack: 3.8.1

4

1 回答 1

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”。我也在考虑同样的事情。

于 2018-12-17T09:27:39.850 回答