Skip to content

Prerender pages with query to SSR and Localize #29587

Closed

Description

@detobel36

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

No response

Description

When building an angular project where SSR and Localize are set up in addition to hybrid rendering, an error occurs.
The host "ng-localhost" is used and obviously, the request to SSR failed.
I build using the command: ng build --localize

I want pre-rendered pages that call the method I declare in SSR to load some content from a database and build the website. It makes sense because this database is not updated often (it lists for example the menu items).

I don't have the error if localize is not set up.

Minimal Reproduction

https://github.com/detobel36/angular-ssr-localize

Exception or Error

ERROR Wr {
  headers: e {
    headers: Map(0) {},
    normalizedNames: Map(0) {},
    lazyInit: undefined,
    lazyUpdate: null
  },
  status: 0,
  statusText: 'Unknown Error',
  url: 'http://ng-localhost/api/data',
  ok: false,
  type: undefined,
  name: 'HttpErrorResponse',
  message: 'Http failure response for http://ng-localhost/api/data: 0 undefined',
  error: TypeError: fetch failed
      at node:internal/deps/undici/undici:13502:13
      at a.invoke (file:///home/rdetobel/Documents/Developpement/test-ssr/.angular/prerender-root/44393660-3cef-487c-bebf-fce65705e2ef/polyfills.server.mjs:1:6853)
      at l.run (file:///home/rdetobel/Documents/Developpement/test-ssr/.angular/prerender-root/44393660-3cef-487c-bebf-fce65705e2ef/polyfills.server.mjs:1:2099)
      at file:///home/rdetobel/Documents/Developpement/test-ssr/.angular/prerender-root/44393660-3cef-487c-bebf-fce65705e2ef/polyfills.server.mjs:2:582
      at a.invokeTask (file:///home/rdetobel/Documents/Developpement/test-ssr/.angular/prerender-root/44393660-3cef-487c-bebf-fce65705e2ef/polyfills.server.mjs:1:7482)
      at l.runTask (file:///home/rdetobel/Documents/Developpement/test-ssr/.angular/prerender-root/44393660-3cef-487c-bebf-fce65705e2ef/polyfills.server.mjs:1:2747)
      at R (file:///home/rdetobel/Documents/Developpement/test-ssr/.angular/prerender-root/44393660-3cef-487c-bebf-fce65705e2ef/polyfills.server.mjs:1:9542)
      at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
    [cause]: Error: getaddrinfo EAI_AGAIN ng-localhost
        at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:120:26) {
      errno: -3001,
      code: 'EAI_AGAIN',
      syscall: 'getaddrinfo',
      hostname: 'ng-localhost'
    }
  }
}

Your Environment

Angular CLI: 19.1.6
Node: 22.13.1
Package Manager: yarn 1.22.22
OS: linux x64

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

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1901.6
@angular-devkit/build-angular   19.1.6
@angular-devkit/core            19.1.6
@angular-devkit/schematics      19.1.6
@angular/cli                    19.1.6
@angular/ssr                    19.1.6
@schematics/angular             19.1.6
rxjs                            7.8.1
typescript                      5.7.3
zone.js                         0.15.0

Anything else relevant?

No response

Activity

  1. added
    freq1: low
    on Feb 10, 2025
  2. self-assigned this
    on Feb 10, 2025
  3. added 2 commits that reference this issue on Feb 10, 2025
    8ca9b72
    08720dc
  4. added a commit that references this issue on Feb 10, 2025
    0826315
  5. added a commit that references this issue on Feb 10, 2025
    b553069
  6. angular-automatic-lock-bot commented on Mar 13, 2025

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  7. locked and limited conversation to collaborators on Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: @angular/buildfreq1: lowseverity3: brokentype: bug/fix

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions