如何找到“非法文字图”

时间:2018-08-30 06:36:47

标签: angular6

我正在将应用程序从Angular 5迁移到Angular6。目前,我相信我已经解决了大多数问题,并且在使用ng serveng build main进行构建时,它的构建符合预期。但是,当以ng build --prod main进行构建时,出现以下错误

ERROR in : Error: Illegal State: literal maps should have been converted into functions
    at _AstToIrVisitor.visitLiteralMap (/workspace/tarnished-lamp/node_modules/@angular/compiler/bundles/compiler.umd.js:15824:19)
    at LiteralMap.visit (/workspace/tarnished-lamp/node_modules/@angular/compiler/bundles/compiler.umd.js:3483:28)
    at ASTWithSource.visit (/workspace/tarnished-lamp/node_modules/@angular/compiler/bundles/compiler.umd.js:3598:29)
    at convertPropertyBinding (/workspace/tarnished-lamp/node_modules/@angular/compiler/bundles/compiler.umd.js:15626:52)
    at createHostBindingsFunction (/workspace/tarnished-lamp/node_modules/@angular/compiler/bundles/compiler.umd.js:20068:39)
    at baseDirectiveFields (/workspace/tarnished-lamp/node_modules/@angular/compiler/bundles/compiler.umd.js:19754:43)
    at compileComponentFromMetadata (/workspace/tarnished-lamp/node_modules/@angular/compiler/bundles/compiler.umd.js:19793:29)
    at compileComponentFromRender2 (/workspace/tarnished-lamp/node_modules/@angular/compiler/bundles/compiler.umd.js:19878:19)
    at /workspace/tarnished-lamp/node_modules/@angular/compiler/bundles/compiler.umd.js:21551:21
    at Array.forEach (<anonymous>)
    at AotCompiler._compilePartialModule (/workspace/tarnished-lamp/node_modules/@angular/compiler/bundles/compiler.umd.js:21527:24)
    at /workspace/tarnished-lamp/node_modules/@angular/compiler/bundles/compiler.umd.js:21509:58
    at Array.forEach (<anonymous>)
    at AotCompiler.emitAllPartialModules (/workspace/tarnished-lamp/node_modules/@angular/compiler/bundles/compiler.umd.js:21509:19)
    at AngularCompilerProgram._emitRender3 (/workspace/tarnished-lamp/node_modules/@angular/compiler-cli/src/transformers/program.js:252:41)
    at AngularCompilerProgram.emit (/workspace/tarnished-lamp/node_modules/@angular/compiler-cli/src/transformers/program.js:235:59)

我对此有两个疑问

  1. 此错误实际上是什么意思
  2. 我如何找到它并对其进行纠正

1 个答案:

答案 0 :(得分:0)

从angular 6.0迁移到7.0后,我启用了ivy编译器,并且遇到了相同的错误。 禁用常春藤选项,AOT构建将再次起作用。