ng build 失败。见下文。
==> ng build --prod
Date: 2018-06-01T10:20:07.564Z
Hash: e43a7d775a617f72e760
Time: 84869ms
chunk {scripts} scripts.385b291e179030219400.bundle.js (scripts) 137 kB [initial] [rendered]
chunk {0} main.eb9c978f12021c39965e.bundle.js (main) 2.22 MB [initial] [rendered]
chunk {1} polyfills.c9bd3d92b786a9531262.bundle.js (polyfills) 166 kB [initial] [rendered]
chunk {2} styles.e270cced36800690ed11.bundle.css (styles) 307 kB [initial] [rendered]
chunk {3} inline.318b50c57b4eba3d437b.bundle.js (inline) 796 bytes [entry] [rendered]
ERROR in ./node_modules/ag-grid/dist/lib/gridOptionsWrapper.js
Module build failed: RangeError: Maximum call stack size exceeded
at Object.forEachChild (/home/jhalliley/work/my-ui/node_modules/@angular-devkit/build-optimizer/node_modules/typescript/lib/typescript.js:12719:26)
at traverse (/home/jhalliley/work/my-ui/node_modules/@angular-devkit/build-optimizer/node_modules/typescript/lib/typescript.js:29674:110)
at visitNode (/home/jhalliley/work/my-ui/node_modules/@angular-devkit/build-optimizer/node_modules/typescript/lib/typescript.js:12690:24)
at Object.forEachChild (/home/jhalliley/work/my-ui/node_modules/@angular-devkit/build-optimizer/node_modules/typescript/lib/typescript.js:12821:24)
at traverse (/home/jhalliley/work/my-ui/node_modules/@angular-devkit/build-optimizer/node_modules/typescript/lib/typescript.js:29674:110)
at visitNode (/home/jhalliley/work/my-ui/node_modules/@angular-devkit/build-optimizer/node_modules/typescript/lib/typescript.js:12690:24)
at Object.forEachChild (/home/jhalliley/work/my-ui/node_modules/@angular-devkit/build-optimizer/node_modules/typescript/lib/typescript.js:12915:24)
at traverse (/home/jhalliley/work/my-ui/node_modules/@angular-devkit/build-optimizer/node_modules/typescript/lib/typescript.js:29674:110)
at visitNodes (/home/jhalliley/work/my-ui/node_modules/@angular-devkit/build-optimizer/node_modules/typescript/lib/typescript.js:12699:30)
at Object.forEachChild (/home/jhalliley/work/my-ui/node_modules/@angular-devkit/build-optimizer/node_modules/typescript/lib/typescript.js:12875:24)
at traverse (/home/jhalliley/work/my-ui/node_modules/@angular-devkit/build-optimizer/node_modules/typescript/lib/typescript.js:29674:110)
at containsArgumentsReference (/home/jhalliley/work/my-ui/node_modules/@angular-devkit/build-optimizer/node_modules/typescript/lib/typescript.js:29657:56)
at getSignatureFromDeclaration (/home/jhalliley/work/my-ui/node_modules/@angular-devkit/build-optimizer/node_modules/typescript/lib/typescript.js:29618:84)
at getSignaturesOfSymbol (/home/jhalliley/work/my-ui/node_modules/@angular-devkit/build-optimizer/node_modules/typescript/lib/typescript.js:29708:37)
at resolveAnonymousTypeMembers (/home/jhalliley/work/my-ui/node_modules/@angular-devkit/build-optimizer/node_modules/typescript/lib/typescript.js:28899:43)
at resolveStructuredTypeMembers (/home/jhalliley/work/my-ui/node_modules/@angular-devkit/build-optimizer/node_modules/typescript/lib/typescript.js:29031:25)
有关如何使此构建成功的任何想法?这是ag-grid问题还是ng build问题?我没有看到增加ng build的堆栈大小的方法。
答案 0 :(得分:0)
我通过在生产版本中关闭版本优化器解决了这一问题。这不是理想的解决方案。但是,在找到合适的解决方案之前,该方法一直有效。
ng build --prod --build-optimizer=false
注意:关闭优化可能会增加构建输出的大小。
更新:我最终降级到17.1.1,就解决了这个问题。