首页 > 解决方案 > StaticInjectorError(Platform: core)[CompilerFactory] ​​| NullInjectorError:没有 CompilerFactory 的提供者

问题描述

我在尝试从角度 2 升级到角度 5 时收到以下错误

Uncaught Error: StaticInjectorError(Platform: core)[CompilerFactory]: 
  NullInjectorError: No provider for CompilerFactory!
    at _NullInjector.get (core.js:994)
    at resolveToken (core.js:1292)
    at tryResolveToken (core.js:1234)
    at StaticInjector.get (core.js:1102)
    at PlatformRef.bootstrapModule (core.js:5548)
    at main (client.ts:24)
    at Object.bootloader (index.js:12)
    at Object.<anonymous> (client.ts:28)
    at __webpack_require__ (bootstrap 031c386073943e31b8d3:19)
    at bootstrap 031c386073943e31b8d3:62

这不是 Angular CLI 应用程序,因此我在 git 上创建了一个存储库,以尽量减少问题的重现。请参考以下链接

请参阅 README.md 以构建和提供应用程序。

使用 webpack:3.11.0 来构建这个应用程序。

标签: angularwebpackangular-universal

解决方案


推荐阅读