RangeError中的AoT错误:在StaticReflector.annotations处的Map.get(本机)处超出了最大调用堆栈大小

时间:2017-09-17 17:09:00

标签: angular angular-cli

尝试在我的项目上执行ng build --prod时,会产生以下结果:

Date: 2017-09-17T16:03:06.816Z                                                     
Hash: d776bf985f9664cac088
Time: 3714ms
chunk {0} styles.d41d8cd98f00b204e980.bundle.css (styles) 0 bytes {3} [initial] [rendered]
chunk {1} polyfills.3bc34265385d52184eab.bundle.js (polyfills) 86 bytes {3} [initial] [rendered]
chunk {2} main.e402deade8b026b7d50e.bundle.js (main) 84 bytes [initial] [rendered]
chunk {3} inline.22b7623ed7c5ac6f9a35.bundle.js (inline) 1.45 kB [entry] [rendered]

ERROR in RangeError: Maximum call stack size exceeded
    at Map.get (native)
    at CompileMetadataResolver.getNgModuleMetadata (/Users/chris/Documents/concord/node_modules/@angular/compiler/bundles/compiler.umd.js:15542:64)
    at CompileMetadataResolver.getNgModuleSummary (/Users/chris/Documents/concord/node_modules/@angular/compiler/bundles/compiler.umd.js:15502:52)
    at /Users/chris/Documents/concord/node_modules/@angular/compiler/bundles/compiler.umd.js:15594:68
    at Array.forEach (native)
    at CompileMetadataResolver.getNgModuleMetadata (/Users/chris/Documents/concord/node_modules/@angular/compiler/bundles/compiler.umd.js:15589:49)
    at CompileMetadataResolver.getNgModuleSummary (/Users/chris/Documents/concord/node_modules/@angular/compiler/bundles/compiler.umd.js:15502:52)
    at /Users/chris/Documents/concord/node_modules/@angular/compiler/bundles/compiler.umd.js:15594:68
    at Array.forEach (native)
    at CompileMetadataResolver.getNgModuleMetadata (/Users/chris/Documents/concord/node_modules/@angular/compiler/bundles/compiler.umd.js:15589:49)
    at CompileMetadataResolver.getNgModuleSummary (/Users/chris/Documents/concord/node_modules/@angular/compiler/bundles/compiler.umd.js:15502:52)
    at /Users/chris/Documents/concord/node_modules/@angular/compiler/bundles/compiler.umd.js:15594:68
    at Array.forEach (native)
    at CompileMetadataResolver.getNgModuleMetadata (/Users/chris/Documents/concord/node_modules/@angular/compiler/bundles/compiler.umd.js:15589:49)
    at CompileMetadataResolver.getNgModuleSummary (/Users/chris/Documents/concord/node_modules/@angular/compiler/bundles/compiler.umd.js:15502:52)
    at /Users/chris/Documents/concord/node_modules/@angular/compiler/bundles/compiler.umd.js:15594:68
    at Array.forEach (native)
    at CompileMetadataResolver.getNgModuleMetadata (/Users/chris/Documents/concord/node_modules/@angular/compiler/bundles/compiler.umd.js:15589:49)
    at CompileMetadataResolver.getNgModuleSummary (/Users/chris/Documents/concord/node_modules/@angular/compiler/bundles/compiler.umd.js:15502:52)
    at /Users/chris/Documents/concord/node_modules/@angular/compiler/bundles/compiler.umd.js:15594:68
    at Array.forEach (native)
    at CompileMetadataResolver.getNgModuleMetadata (/Users/chris/Documents/concord/node_modules/@angular/compiler/bundles/compiler.umd.js:15589:49)

使用常规ng buildng build --env=prod可以正常工作,但每当使用AoT时,它都会失败。我发现了很多类似的问题,但没有一个解决方案适用于我的项目。

  • @ angular / cli:1.4.2
  • node:6.10.3
  • angular:4.4.1
  • npm:3.10.10
  • os:macOS Sierra

0 个答案:

没有答案