通用渲染时 HttpInterceptingHandler 不是构造函数 angularjs 6
HttpInterceptingHandler is not a constructor while universal rendering 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 (/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)
只需更新您的 angular 依赖项
ng update @angular/core
它将解决问题。
我正在尝试设置 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 (/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)
只需更新您的 angular 依赖项
ng update @angular/core
它将解决问题。