Skip to content

node: skip ssr for pre-rendered pages#15164

Merged
matthewp merged 1 commit intonextfrom
hd/fix-node-ssr-prerender-page-404
Jan 11, 2026
Merged

node: skip ssr for pre-rendered pages#15164
matthewp merged 1 commit intonextfrom
hd/fix-node-ssr-prerender-page-404

Conversation

@HiDeoo
Copy link
Copy Markdown
Member

@HiDeoo HiDeoo commented Jan 10, 2026

Changes

Initially reported on Discord, this PR fixes an issue where visiting an unknown route matching the pattern of a pre-rendered dynamic route (e.g., /dogs/unknown when /dogs/[dog] is pre-rendered) would cause the Node.js adapter to fail to serve the expected 404 page.

  • Repro
  • Previously, pre-rendered routes were not part of the manifest due to this condition. When matching all routes (including pre-rendered ones to include redirects), the Node.js adapter would now attempt to ssr pre-rendered pages matching the request.

Testing

I added a pre-rendered dynamic route in an existing fixture and added tests to verify that visiting both the pre-rendered route and an unknown route matching its pattern behaves as expected.

Docs

This is a bug fix; no doc updates are needed.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Jan 10, 2026

🦋 Changeset detected

Latest commit: dfeb235

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: integration Related to any renderer integration (scope) label Jan 10, 2026
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ Package Trust Level Decreased

Caution

Decreased trust levels may indicate a higher risk of supply chain attacks. Please review these changes carefully.

📦 Package 🔒 Before 🔓 After
@cloudflare/kv-asset-handler trusted-with-provenance none
@cloudflare/unenv-preset trusted-with-provenance none
workerd trusted-with-provenance none
undici provenance none
miniflare trusted-with-provenance none
youch provenance none
@cloudflare/workerd-darwin-64 trusted-with-provenance none
@cloudflare/workerd-darwin-arm64 trusted-with-provenance none
@cloudflare/workerd-linux-64 trusted-with-provenance none
@cloudflare/workerd-linux-arm64 trusted-with-provenance none
@cloudflare/workerd-windows-64 trusted-with-provenance none
wrangler trusted-with-provenance none

@HiDeoo HiDeoo marked this pull request as ready for review January 10, 2026 11:10
@HiDeoo HiDeoo mentioned this pull request Jan 10, 2026
10 tasks
Copy link
Copy Markdown
Contributor

@matthewp matthewp left a comment

Choose a reason for hiding this comment

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

great test!

@matthewp matthewp merged commit 54dc11d into next Jan 11, 2026
40 of 41 checks passed
@matthewp matthewp deleted the hd/fix-node-ssr-prerender-page-404 branch January 11, 2026 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: integration Related to any renderer integration (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants