Skip to content

Resource hasValue() is false for a moment when using TransferState cached data, causing hydration to fail #62897

@zip-fa

Description

@zip-fa

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

core

Is this a regression?

No

Description

A minimal reproduction demonstrating hydration issues when using @else and @empty blocks with the control flow syntax. The app fetches Pokemon data (httpClient + rxResource + transfer state enabled) and displays three scenarios:

  1. Works: Uses separate @if blocks - hydration works correctly
Image
  1. Broken: Uses @if/@else blocks - hydration fails
Image
  1. Broken: Uses @for/@empty blocks - hydration fails
Image

Expected: All components should hydrate properly
Actual: When using @else or @empty, components are not hydrating

Please provide a link to a minimal reproduction of the bug

https://github.com/zip-fa/ng20-new-hydration-issue

Please provide the exception or error you saw


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

ng version

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 20.1.3
Node: 24.2.0
Package Manager: npm 11.3.0
OS: darwin arm64

Angular: 20.1.3
... build, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-server, router, ssr

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.2001.3
@angular-devkit/core         20.1.3
@angular-devkit/schematics   20.1.3
@schematics/angular          20.1.3
rxjs                         7.8.2
typescript                   5.8.3

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions