Can't resolve all parameters for Application Module: (?). at syntaxError (compiler.js:1021) site:stackoverflow.com

心已入冬 提交于 2019-12-11 06:34:56

问题


After downgrading my Angular project from version 7 to 6 and integrating Angular Universal with the help of @ngToolkit, I'm getting the following error message in the browser console:

Can't resolve all parameters for Application Module: (?). at syntaxError (compiler.js:1021)

I downgraded the project by simply overwriting the dependencies like described here. As already described the error only occurs in the browser console, while to compilation of the project is completing successfully.


回答1:


You’re apparently affected by issue 26128 that was introduced in Angular 6.1.8. As IgorMinar explained (emphasis mine):

I noticed that in the past under certain circumstances you were able to use the JIT compiler without the Reflect.metadata polyfill. But with a recent change […], we now require you to load it before anything from @angular/core is imported. This will be done automatically by cli v7 so the change will be transparent to most users, unless you have a custom polyfill setup in which case you need to ensure that the polyfill is loaded before Angular.

In case of Angular ^6.1.8 || ^7.0.0 with Webpack (i.e. not Angular CLI), you have to import reflect-metadata (before any @angular/core imports—as stated above).



来源:https://stackoverflow.com/questions/55590935/cant-resolve-all-parameters-for-application-module-at-syntaxerror-compil

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!