Skip to content

fix(@angular/build): generate a separate server chunk for each preren… - #34723

Merged
alan-agius4 merged 1 commit into
angular:mainfrom
SkyZeroZx:fix/server-asset-chunk-collision
Nov 16, 2026
Merged

alan-agius4 merged 1 commit into
angular:mainfrom
SkyZeroZx:fix/server-asset-chunk-collision

Conversation

@SkyZeroZx

@SkyZeroZx SkyZeroZx commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

…dered page

Server asset chunks were named after the page path with . and / replaced by _, so pages such as blog/archive and blog_archive shared one chunk and one of them was served in place of the other. Chunk paths now mirror the page path.

Fixes #34722

PR Checklist

Please check to confirm your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

…dered page

Server asset chunks were named after the page path with `.` and `/`
replaced by `_`, so pages such as `blog/archive` and `blog_archive`
shared one chunk and one of them was served in place of the other.
Chunk paths now mirror the page path.

Fixes angular#34722

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request modifies the server-rendering manifest generation to use the original asset path directly for chunk file paths instead of replacing dots and slashes with underscores, preventing different assets from sharing the same chunk. A unit test has been added to verify this behavior. No review comments were provided, and I have no feedback to provide as the implementation is correct and well-tested.

@alan-agius4 alan-agius4 added target: patch This PR is targeted for the next patch release action: merge The PR is ready for merge by the caretaker labels Nov 16, 2026

@alan-agius4 alan-agius4 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@alan-agius4
alan-agius4 merged commit be9e3a0 into angular:main Nov 16, 2026
42 checks passed
@alan-agius4

Copy link
Copy Markdown
Collaborator

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

@SkyZeroZx

Copy link
Copy Markdown
Contributor Author

@alan-agius4 As a question, can this be backported, or we only consider this a hardening?

@alan-agius4

Copy link
Copy Markdown
Collaborator

@SkyZeroZx We consider this a regular bug fix / hardening improvement rather than a security vulnerability.

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.

Angular SSR prerender chunk-name collision desynchronizes Content-Length and contaminates other users' responses behind a proxy

2 participants