Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prerender pages with query to SSR and Localize #29587

Closed
1 task
detobel36 opened this issue Feb 7, 2025 · 1 comment · Fixed by #29595
Closed
1 task

Prerender pages with query to SSR and Localize #29587

detobel36 opened this issue Feb 7, 2025 · 1 comment · Fixed by #29595
Assignees
Labels
area: @angular/build freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix

Comments

@detobel36
Copy link

detobel36 commented Feb 7, 2025

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

@detobel36 detobel36 marked this as a duplicate of angular/angular#59890 Feb 7, 2025
@alan-agius4 alan-agius4 added type: bug/fix freq1: low Only reported by a handful of users who observe it rarely severity3: broken area: @angular/build labels Feb 10, 2025
@alan-agius4 alan-agius4 self-assigned this Feb 10, 2025
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Feb 10, 2025
…d prerender

Ensure proper handling of unlocalizable files during localized prerendering to prevent errors.

Closes angular#29587
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Feb 10, 2025
…d prerender

Ensure proper handling of unlocalizable files during localized prerendering to prevent errors.

Closes angular#29587
alan-agius4 added a commit that referenced this issue Feb 10, 2025
…d prerender

Ensure proper handling of unlocalizable files during localized prerendering to prevent errors.

Closes #29587

(cherry picked from commit b553069)
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Mar 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: @angular/build freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix
Projects
None yet
2 participants