【问题标题】:Angular AOT unknown identifier undefinedAngular AOT 未知标识符未定义
【发布时间】:2017-10-14 22:37:11
【问题描述】:

我正在尝试在我的 Angular 项目上运行 AOT 编译,但是当我运行命令时

"./node_modules/.bin/ngc" -p tsconfig-aot.json 

我收到以下错误:

Error: Internal error: unknown identifier undefined
    at Object.importExpr$$1 [as importExpr] (..\node_modules\@angular\compiler\bundles\compiler.umd.js:24071:23)
    at tokenExpr ..\node_modules\@angular\compiler\bundles\compiler.umd.js:18428:39)
    at providerDef (..\node_modules\@angular\compiler\bundles\compiler.umd.js:18331:20)
    at ..\node_modules\@angular\compiler\bundles\compiler.umd.js:18548:77
    at Array.map (native)
    at NgModuleCompiler.compile (..\node_modules\@angular\compiler\bundles\compiler.umd.js:18548:44)
    at AotCompiler._compileModule (..\node_modules\@angular\compiler\bundles\compiler.umd.js:24004:32)
    at ..\node_modules\@angular\compiler\bundles\compiler.umd.js:23916:66
    at Array.forEach (native)
    at AotCompiler._compileImplFile (..\node_modules\@angular\compiler\bundles\compiler.umd.js:23916:19) Compilation failed

我如何知道错误在哪个文件中,错误是什么?

【问题讨论】:

  • 你有这个问题的复制品吗?
  • @yurzui 你说的复制是什么意思?这是一个相当大的项目,基于Jhipster,不知道从哪里开始调试
  • 说真的,如何在大型应用程序中调试此问题?错误应该有更多信息。 @PauloHenriquedeSiqueira 你是怎么解决这个问题的?

标签: angular angular2-aot angular-aot


【解决方案1】:

我们最近遇到了同样的问题,它是缺少从 @angular/common 模块导入的 Location

【讨论】:

    猜你喜欢
    • 2018-03-15
    • 2019-03-11
    • 2021-03-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多