Skip to content

fix: serve prerendered data for trailing slash routes - #1385

Merged
fhammerschmidt merged 1 commit into
masterfrom
fix/search-route-data-1382
Sep 29, 2026
Merged

fhammerschmidt merged 1 commit into
masterfrom
fix/search-route-data-1382

Conversation

@fhammerschmidt

Copy link
Copy Markdown
Member

Context

Search results use the site's canonical trailing-slash URLs. React Router 8 requests /page/_.data when navigating to those URLs, but prerendering currently emits only /page.data. Cloudflare serves HTML for the missing data path, causing the turbo-stream decode error.

Changes

  • Copy prerendered route data to matching trailing-slash data paths during the build.
  • Preserve the canonical page URLs and the existing non-trailing-slash data files.

Verification

  • fnm exec --using 26.3.0 yarn build:vite
  • Verified that the two data files for a documentation route are byte-identical in both build/client and out.
  • Verified with a local Cloudflare Pages preview that both data paths return 200 with application/octet-stream, while the page URL still redirects to its trailing-slash form.

Fixes #1382

This PR carries the same commit as #1383 on a branch in the rescript-lang repository and can supersede it.

Copy prerendered route data to the trailing-slash paths requested by React Router so search results can navigate without decoding the HTML fallback.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-29T16:39:54.533619Z 3d7a445 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copy link
Copy Markdown
Member Author

@codex review

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
guide 3d7a445 Commit Preview URL

Branch Preview URL
Sep 29 2026, 04:36 PM

@github-actions

Copy link
Copy Markdown
Contributor

Docs preview

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 3d7a44567b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions

Copy link
Copy Markdown
Contributor

Lighthouse baseline

Compared with target branch master at commit 9b534e2. Scores are the median of 3 runs against the deployed Cloudflare preview.

Category Target Current Change
Performance 80 88 +8
Accessibility 80 80 0
Best practices 100 100 0
SEO 92 58 -34

Download the full Lighthouse reports and baseline

Commit ae85637 · Cloudflare preview

@fhammerschmidt
fhammerschmidt merged commit e590848 into master Sep 29, 2026
23 checks passed
@fhammerschmidt
fhammerschmidt deleted the fix/search-route-data-1382 branch September 29, 2026 21:09

This branch was successfully deployed

3 active deployments
preview — 3d7a4456 Deployed Sep 29, 2026 by github-actions[bot]
guide-preview — 3d7a4456 Deployed Sep 29, 2026 by github-actions[bot]
fork-preview — 3d7a4456 Deployed Sep 26, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Runtime error when using the search

1 participant