简体   繁体   English

Angular AoT和汇总-错误:未加载运行时编译器

[英]Angular AoT and Rollup - Error: Runtime compiler is not loaded

I have a been building a dashboard application using Angular for the last 6 months in that time I have had a really nice development workflow using JiT compilation and gulp browser sync to get instant updates when I make changes. 在过去的6个月中,我一直在使用Angular构建仪表板应用程序,我使用JiT编译和gulp浏览器同步获得了非常不错的开发工作流程,以便在进行更改时立即获得更新。 Which has worked great. 效果很好。

I have come to the point where I am happy to deploy a production version, however, I have run into issues with AoT and rollup. 我很高兴部署了生产版本,但是我遇到了AoT和汇总问题。

I have followed the angular.io guide but got the following 我遵循了angular.io指南,但得到了以下内容

ERROR Error: Uncaught (in promise): Error: Runtime compiler is not loaded
Error: Runtime compiler is not loaded
    at _throwError (build.js:5036)
    at Compiler.compileModuleAsync (build.js:5065)
    at MergeMapSubscriber.project (build.js:34798)
    at MergeMapSubscriber._tryNext (build.js:30450)
    at MergeMapSubscriber._next (build.js:30440)
    at MergeMapSubscriber.Subscriber.next (build.js:425)
    at ScalarObservable._subscribe (build.js:846)
    at ScalarObservable.Observable._trySubscribe (build.js:708)
    at ScalarObservable.Observable.subscribe (build.js:696)
    at MergeMapOperator.call (build.js:30415)
    at _throwError (build.js:5036)
    at Compiler.compileModuleAsync (build.js:5065)
    at MergeMapSubscriber.project (build.js:34798)
    at MergeMapSubscriber._tryNext (build.js:30450)
    at MergeMapSubscriber._next (build.js:30440)
    at MergeMapSubscriber.Subscriber.next (build.js:425)
    at ScalarObservable._subscribe (build.js:846)
    at ScalarObservable.Observable._trySubscribe (build.js:708)
    at ScalarObservable.Observable.subscribe (build.js:696)
    at MergeMapOperator.call (build.js:30415)
    at resolvePromise (zone.js:769)
    at resolvePromise (zone.js:740)
    at zone.js:817
    at ZoneDelegate.invokeTask (zone.js:424)
    at Object.onInvokeTask (build.js:6048)
    at ZoneDelegate.invokeTask (zone.js:423)
    at Zone.runTask (zone.js:191)
    at drainMicroTaskQueue (zone.js:584)
    at ZoneTask.invoke (zone.js:490)

I am also using a number of different angular plugins that could be causing the issue (however I couldn't find any reference to an AoT issue) namely MyDatePicker and MyDateRangePicker . 我还使用了许多可能导致此问题的角度插件(但是我找不到对AoT问题的任何引用),即MyDatePickerMyDateRangePicker I also have a couple of js libraries including D3.js and momement.js 我也有几个js库,包括D3.jsmomement.js

So my question is, is there somthing that I am doing wrong that is causing my build.js file to throw runtime compiler is not loading? 所以我的问题是, 我是否在做错什么导致我的build.js文件抛出运行时编译器未加载?

If anyone has any insight into the issue it would be greatly appreciated if you require any specific code snippets let me know, as I mentioned my tsconfig-aot.json and rollup-config.json is essentially the same as in angular.io 如果有人对这个问题有任何见解,那么如果您需要任何特定的代码片段让我知道,将不胜感激,正如我提到的,我的tsconfig-aot.jsonrollup-config.json与angular.io基本上相同

Thanks in advance 提前致谢

Big thanks to yurzui in the comments for helping me answer my own question. 非常感谢yurzui在评论中帮助我回答了自己的问题。

The approach that helped me find where the runtime compiler was being loaded in was to go into my generated build.js and finding the use of compileModuleAsync . 帮助我找到运行时编译器的加载位置的方法是进入生成的build.js,并找到compileModuleAsync I found it within the loadChildren method, after removing its use the project ran successfully in the browser. 删除使用后,我在loadChildren方法中找到了它,该项目在浏览器中成功运行。

However, I am not sure as to why loadChildren is causing the compiler to load in on rollup. 但是,我不确定为什么loadChildren导致编译器在汇总时加载。

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 AngularCli 和 AOT:错误 错误:未加载运行时编译器 - AngularCli & AOT: ERROR Error: Runtime compiler is not loaded 加载动态组件时出现Angular 4 AOT编译错误:未加载运行时编译器 - Angular 4 AOT Compilation Error while loading a Dynamic Component: Runtime compiler is not loaded 错误:未加载运行时编译器错误:未在angular 2中加载运行时编译器 - Error: Runtime compiler is not loaded Error: Runtime compiler is not loaded in angular 2 Angular 8 - 获取运行时编译器未加载错误 - Angular 8 - Getting Runtime compiler not loaded error 错误:未加载运行时编译器:在 Angular 7 中进行生产构建 - Error : Runtime compiler is not loaded : On production build in Angular 7 未捕获(承诺):错误:未加载运行时编译器 Angular 8 - Uncaught (in promise): Error: Runtime compiler is not loaded Angular 8 使用Rollup for Angular 2的AoT编译器并导入Moment.js - Using Rollup for Angular 2's AoT compiler and importing Moment.js Angular 5 Runtime编译器未加载 - Angular 5 Runtime compiler is not loaded Angular 2 AoT编译器动画回调错误 - Angular 2 AoT compiler animations callback error Angular 2 AoT编译器:没有错误,但是肯定有问题 - Angular 2 AoT compiler: no error but something is definitely wrong
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM