Skip to content

Bug: ssr + zoneless + defer + inputs fails to resolve input data on first render #61038

@jsaguet

Description

@jsaguet

Which @angular/* package(s) are the source of the bug?

I don't know

Is this a regression?

Yes

Description

When using incremental hydration with zoneless change detection, the prerendered html (or returned from SSR) is incorrect.
Template is incomplete in the generated HTML for components inside @defer(hydrate never).

This behavior seems to be the same no matter the hydrate trigger.

When using zone change detection, the prerendering works fine.

Please provide a link to a minimal reproduction of the bug

https://github.com/jsaguet/ng-zoneless-hydration-prerender

Please provide the exception or error you saw

The generated html in index.html is incorrect:

<app-hydrated><p></p></app-hydrated>

when it should have been

<app-hydrated><p>Hydrate Never works!</p></app-hydrated>

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 19.0.5
Node: 22.13.0
Package Manager: npm 10.9.2
OS: win32 x64

Angular: 19.0.5
... animations, build, cli, common, compiler, compiler-cli, core
... platform-browser, platform-browser-dynamic, platform-server
... router, ssr

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.1900.5
@angular-devkit/core         19.0.5
@angular-devkit/schematics   19.0.5
@schematics/angular          19.0.5
rxjs                         7.8.2
typescript                   5.6.3
zone.js                      0.15.0

Anything else?

The regression starts with Angular 19.0.5 and seems to have been fixed in 20.0.0-next.4

I'm not sure which commit in the 20.0.0-next.4 release fixes it but it would be great to have it backported to the release 19 even though zoneless is still experimental in this version.

Metadata

Metadata

Assignees

Labels

area: coreIssues related to the framework runtimearea: serverIssues related to server-side renderingcore: deferIssues related to @defer blocks.

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions