Hosting details for Cloudflare Workers doesn't work for single-page app on Cloudflare Pages
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.1k
- Forks
- 1.9k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 143
Description
Which project does this relate to?
Start
Describe the bug
SPA (single-page app) mode isn't able to the shell properly locally or on Cloudflare Pages. This is because Pages expects the shell at /index.html and doesn't appear to accept a redirect.
Your Example Website or App
tbc
Steps to Reproduce the Bug or Issue
As per directions in docs for SPA mode
- Configuring SPA mode
- Basic Redirects Example
- Shell Mask Path
Expected behavior
SPA shell is transparently loaded when accessing the site root on a local or Cloudflare Pages build.
Screenshots or Videos
No response
Platform
- Start Version: 1.133.27
- OS: N/A, though I use Ubuntu 24.04 for dev env
- Browser: N/A
- Bundler: vite
- Bundler Version: 7.1.12
Additional context
It's possible that using a dynamic routing for the root path is causing or aggravating the issue. For example:
/routes/$id.tsx
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue by following the SPA mode documentation through the Basic Redirects Example and Shell Mask Path steps, including a dynamic route such as /routes/$id.tsx. Compare local behavior with a Cloudflare Pages build and verify that the SPA shell loads transparently at the site root in both environments.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, vite
- Domain
- cloud, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100