1

我正在尝试设置我的服务器端渲染angular app,我已按照此处的说明进行操作:

https://github.com/angular/angular-cli/wiki/stories-universal-rendering

每个命令都成功运行,但是在启动节点服务器后,当我尝试访问该 url 时,它会抛出以下错误:

TypeError: _angular_common_http__WEBPACK_IMPORTED_MODULE_5__.ɵHttpInterceptingHandler is not a constructor
    at zoneWrappedInterceptingHandler (/Stuff/Development/Angular/angular-tuts/universal/dist/server.js:4040:23)
    at _callFactory (/Stuff/Development/Angular/angular-tuts/universal/dist/server.js:14256:20)
    at _createProviderInstance$1 (/Stuff/Development/Angular/angular-tuts/universal/dist/server.js:14210:26)
    at initNgModule (/Stuff/Development/Angular/angular-tuts/universal/dist/server.js:14143:32)
    at new NgModuleRef_ (/Stuff/Development/Angular/angular-tuts/universal/dist/server.js:14872:9)
    at Object.createNgModuleRef (/Stuff/Development/Angular/angular-tuts/universal/dist/server.js:14861:12)
    at NgModuleFactory_.create (/Stuff/Development/Angular/angular-tuts/universal/dist/server.js:17394:25)
    at /Stuff/Development/Angular/angular-tuts/universal/dist/server.js:9693:43
    at ZoneDelegate.invoke (/Stuff/Development/Angular/angular-tuts/universal/dist/server.js:515:26)
    at Object.onInvoke (/Stuff/Development/Angular/angular-tuts/universal/dist/server.js:9035:33)
4

1 回答 1

2

只需更新您的角度依赖项

ng update @angular/core

它将解决问题。

于 2018-06-12T05:20:09.343 回答