Skip to content

@defer doesn't render @placeholder in SSR when @loading present #54385

@zip-fa

Description

@zip-fa

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

core

Is this a regression?

No

Description

Hi.

The docs say:

When rendering an application on the server (either using SSR or SSG), defer blocks always render their @placeholder (or nothing if a placeholder is not specified). Triggers are ignored on the server.

However, this WILL NOT render @placeholder inside SSR environment (it will result in empty content):

@defer (on immediate) {
    <test-component />
  } @loading {
    Loading...
  }  @placeholder {
    Placeholder!!
  }

while this works as expected:

@defer (on immediate) {
    <test-component />
  } @placeholder {
    Placeholder!!
  }

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

No response

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

Angular CLI: 17.1.3
Node: 18.19.0
Package Manager: npm 10.2.3
OS: darwin arm64

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

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1701.3
@angular-devkit/build-angular   17.1.3
@angular-devkit/core            17.1.3
@angular-devkit/schematics      17.1.3
@schematics/angular             17.1.3
rxjs                            7.8.1
typescript                      5.3.3
zone.js                         0.14.3

Anything else?

No response

Metadata

Metadata

Assignees

Labels

area: coreIssues related to the framework runtimecore: deferIssues related to @defer blocks.state: has PR

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions