Use NestJS interceptors instead of legacy Express middleware that directly modifies the response to avoid hydration mismatches in SSR.
Rewrite the legacy middleware as an interceptor that modifies the request or response safely within NestJS’s lifecycle, ensuring proper flow and avoiding breaks in rendering.
.png)

.png)
