Does Angular Hydration work with Prerender

179 Views Asked by At

I want to use client hydration with prerender in an Angular Universal app, but it doesn't seem to work.

I have an Angular Universal app setup and when I run npm run prerender, everything works as expected. No matter how many times I refresh, the same static version that was prerendered is served. So all is good.

But if I enable client hydration by putting this in app.module.ts: providers: [provideClientHydration()]

it starts rendering on the server every time I refresh.

Is this expected or is it a bug? I'm using Angular 16.2.2.

0

There are 0 best solutions below