Skip to content

Angular SSR don't render  #55299

@ABNERMATHEUS

Description

@ABNERMATHEUS

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

platform-server

Is this a regression?

Yes

Description

import { Component, afterNextRender } from '@angular/core';
import { RouterOutlet } from '@angular/router';

@Component({
  selector: 'app-root',
  standalone: true,
  imports: [RouterOutlet],
  templateUrl: './app.component.html',
  styleUrl: './app.component.scss'
})
export class AppComponent {
  title = 'my-app-angular';
  constructor() {
    afterNextRender(() => {
      setTimeout(() => {
        this.title = 'AppComponent rendered'
      }, 3000);

    })
  }
}

After rendered, the variable don't render in screen

image

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.3.3
Node: 20.2.0
Package Manager: npm 9.8.1
OS: win32 x64

Angular:
...

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.1703.3 (cli-only)
@angular-devkit/core         17.3.3 (cli-only)
@angular-devkit/schematics   17.3.3 (cli-only)
@schematics/angular          17.3.3 (cli-only)

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: coreIssues related to the framework runtimearea: docsRelated to the documentation

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions