HttpInterceptingHandler 不是构造函数,而通用渲染 angularjs 6



我正在尝试设置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)

只需更新您的角度依赖关系

ng update @angular/core

它将解决问题。

相关内容

  • 没有找到相关文章

最新更新