Skip to content

fix(@angular/build): resolve assets correctly during i18n prerendering#32714

Merged
clydin merged 1 commit intoangular:mainfrom
alan-agius4:prerender-i18n-assets
Mar 6, 2026
Merged

fix(@angular/build): resolve assets correctly during i18n prerendering#32714
clydin merged 1 commit intoangular:mainfrom
alan-agius4:prerender-i18n-assets

Conversation

@alan-agius4
Copy link
Collaborator

In i18n static output builds, requests for assets made during prerendering (e.g., via HttpClient) include the locale's baseHref. However, the in-memory asset mapping used by the patched server-side fetch did not account for this baseHref, causing assets to fail to resolve.

Closes #32713

@alan-agius4 alan-agius4 added the target: patch This PR is targeted for the next patch release label Mar 6, 2026
@alan-agius4 alan-agius4 requested a review from clydin March 6, 2026 13:38
@alan-agius4 alan-agius4 added the action: review The PR is still awaiting reviews from at least one requested reviewer label Mar 6, 2026
@alan-agius4 alan-agius4 force-pushed the prerender-i18n-assets branch from fcb8dfe to 24c170f Compare March 6, 2026 13:39
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The fix to resolve assets correctly during i18n prerendering by including the baseHref is sound and directly addresses the issue described. The addition of an end-to-end test is a great way to ensure this behavior is covered going forward. The provided suggestions to improve the new test file for better maintainability and robustness are valid and do not conflict with any provided rules.

In i18n static output builds, requests for assets made during prerendering (e.g., via `HttpClient`) include the locale's `baseHref`. However, the in-memory asset mapping used by the patched server-side `fetch` did not account for this `baseHref`, causing assets to fail to resolve.

Closes angular#32713
@alan-agius4 alan-agius4 force-pushed the prerender-i18n-assets branch from 24c170f to 7968780 Compare March 6, 2026 13:44
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Mar 6, 2026
@clydin clydin merged commit f30f890 into angular:main Mar 6, 2026
36 checks passed
@clydin
Copy link
Member

clydin commented Mar 6, 2026

This PR was merged into the repository. The changes were merged into the following branches:

@alan-agius4 alan-agius4 deleted the prerender-i18n-assets branch March 6, 2026 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: @angular/build target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ssr+i18n throw In-memory ESM relative file should always exist

2 participants