Angular 17本地运行时Hydration启用失败(NG0505错误)求助
Angular 17本地运行时Hydration启用失败(NG0505错误)求助
大家好,我最近把项目从Angular 12升级到了17,结果本地用ng serve启动项目的时候,控制台弹出了这么个警告:
NG0505: Angular hydration was requested on the client, but there was no serialized information present in the server response, thus hydration was not enabled. Make sure the
provideClientHydration()is included into the list of providers in the server part of the application configuration.
我用的是NgModule架构,已经在app.module.ts里配置了provideClientHydration(),而且是严格按照Angular官方Hydration相关文档来操作的,但还是遇到了这个问题。
下面是我项目里和服务端渲染相关的server.ts文件开头内容:
import 'zone.js/node'; import { APP_BASE_HREF } from ...
有没有遇到过类似问题的朋友能帮忙看看怎么解决呀?
备注:内容来源于stack exchange,提问作者Malstar
相关产品推荐
相关产品推荐

