Skip to content

Prerender pages with query to SSR and Localize #59890

Closed as duplicate
Closed as duplicate

Description

@detobel36

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

core

Is this a regression?

No

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.

Please provide a link to a minimal reproduction of the bug

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

Please provide the exception or error you saw

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'
    }
  }
}

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

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?

No response

Activity

  1. angular-automatic-lock-bot commented on Mar 10, 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.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions