Skip to content

[Backport 20.3.X] fix(@angular/build): serialize server manifest asset paths - #34510

Merged
alan-agius4 merged 2 commits into
angular:20.3.xfrom
SkyZeroZx:fix/server-manifest-serialization-20.3.x
Oct 27, 2026
Merged

alan-agius4 merged 2 commits into
angular:20.3.xfrom
SkyZeroZx:fix/server-manifest-serialization-20.3.x

Conversation

@SkyZeroZx

Copy link
Copy Markdown
Contributor

Backport of #34493

@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 ensures that asset paths, base hrefs, and other manifest values are safely serialized using JSON.stringify instead of direct interpolation, preventing syntax errors when these values contain JavaScript string delimiters like single quotes. Unit and end-to-end tests have been added to verify this behavior. Feedback is provided on the test helper evaluateManifest to use a more robust regular expression when replacing 'export default', preventing accidental replacements if that substring appears within serialized content.

Comment thread packages/angular/build/src/utils/server-rendering/manifest_spec.ts
Serialize the values embedded in the generated server manifests with
`JSON.stringify`, so a prerendered route such as `ssg/customer's-choice`
no longer produces an invalid manifest.
@alan-agius4
alan-agius4 force-pushed the fix/server-manifest-serialization-20.3.x branch from a50e3c9 to d6f0816 Compare October 26, 2026 10:28
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker target: lts This PR is targeting a version currently in long-term support merge: squash commits When the PR is merged, a squash and merge should be performed labels Oct 27, 2026
@alan-agius4
alan-agius4 merged commit 217033b into angular:20.3.x Oct 27, 2026
32 of 34 checks passed
@alan-agius4

Copy link
Copy Markdown
Collaborator

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

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 merge: squash commits When the PR is merged, a squash and merge should be performed target: lts This PR is targeting a version currently in long-term support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants