Skip to content

Hydration fails for dynamic lazy loaded components with esbuild #53191

Open
@koenig-dominik

Description

@koenig-dominik

Command

build

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

Webpack

Description

The hydration does not detect dynamically rendered components that are lazy loaded when using esbuild, this used to work with webpack

Minimal Reproduction

Here is a minimal reproduction repository with both a working and a broken version:
Broken (Esbuild) https://github.com/koenig-dominik/ng-hydration-regression/tree/ng17-broken
Working (Webpack) https://github.com/koenig-dominik/ng-hydration-regression/tree/ng17-working

Relevant file: https://github.com/koenig-dominik/ng-hydration-regression/blob/ng17-broken/src/app/dynamic.directive.ts

Just execute npm run start and see the difference of hydrated components in the console output

Exception or Error

No response

Your Environment

Angular CLI: 17.0.3
Node: 18.17.1
Package Manager: npm 10.2.3
OS: win32 x64

Angular: 17.0.4
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, platform-server
... router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1700.3 (cli-only)
@angular-devkit/build-angular   17.0.3
@angular-devkit/core            17.0.3 (cli-only)
@angular-devkit/schematics      17.0.3
@angular/cli                    17.0.3
@angular/ssr                    17.0.3
@schematics/angular             17.0.3
rxjs                            7.8.1
typescript                      5.2.2
zone.js                         0.14.2

Anything else relevant?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: serverIssues related to server-side renderingarea: zonesIssues related to zone.js

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      close