【发布时间】:2018-08-06 20:52:56
【问题描述】:
我正在做一个项目,我需要使用 --prod 标志来构建角度代码。
在我们的一个模块中,有一个在运行时创建的组件。
使用开发环境构建时,该项目运行良好。
但是,当使用 --prod 标志时,项目会成功构建,但会在方法“compileModuleAndAllComponentsSync()”处引发运行时异常。
我为此搜索了很多,但没有找到任何有希望的解决方案。有人可以帮我吗?
异常详情:
main.0c80be8a6ff7c0136620.bundle.js:1 ERROR Error: Runtime compiler is not loaded
at fe (main.0c80be8a6ff7c0136620.bundle.js:1)
at e.compileModuleAndAllComponentsSync (main.0c80be8a6ff7c0136620.bundle.js:1)
at e.addComponent (main.0c80be8a6ff7c0136620.bundle.js:1)
at e.onSubmit (main.0c80be8a6ff7c0136620.bundle.js:1)
at Object.handleEvent (main.0c80be8a6ff7c0136620.bundle.js:1)
at Object.handleEvent (main.0c80be8a6ff7c0136620.bundle.js:1)
at Object.handleEvent (main.0c80be8a6ff7c0136620.bundle.js:1)
at cn (main.0c80be8a6ff7c0136620.bundle.js:1)
at main.0c80be8a6ff7c0136620.bundle.js:1
at HTMLButtonElement.<anonymous> (main.0c80be8a6ff7c0136620.bundle.js:1)@ main.0c80be8a6ff7c0136620.bundle.js:1
【问题讨论】:
标签: angular5 angular2-aot