What versions & operating system are you using?
MacOS, wrangler@4.16.1, @cloudflare/vite-plugin@1.2.4
Please provide a link to a minimal reproduction
https://github.com/threepointone/test-wrangler-vite-spa-routing-patterns
Describe the Bug
There are some bugs with routing patterns with both wrangler and the vite plugin when run in "singlae page app mode". I made a repro here https://github.com/threepointone/test-wrangler-vite-spa-routing-patterns, but including the results in this issue as well.
Assume we have an assets directory that looks like this:
public/
index.html
xyz.html
abc/
index.html
def.html
with a configuration (as in wrangler.jsonc) that looks like this:
Here's a table of paths, expected files to be loaded, and what files actually get loaded.
| Path |
Expected |
Actual (wrangler) |
Actual (vite) |
| / |
index.html |
index.html ✅ |
index.html ✅ |
| /xyz |
xyz.html |
xyz.html ✅ |
index.html ❌ |
| /xyz/asdasd |
index.html |
index.html ✅ |
index.html ❌ |
| /abc/ |
abc/index.html |
abc/index.html ✅ |
index.html ❌ |
| /abc/def |
abc/def.html |
abc/def.html ✅ |
index.html ❌ |
| /abc/def/ghi |
abc/index.html |
index.html ❌ |
index.html ❌ |
Please provide any relevant error logs
No response
What versions & operating system are you using?
MacOS, wrangler@4.16.1, @cloudflare/vite-plugin@1.2.4
Please provide a link to a minimal reproduction
https://github.com/threepointone/test-wrangler-vite-spa-routing-patterns
Describe the Bug
There are some bugs with routing patterns with both wrangler and the vite plugin when run in "singlae page app mode". I made a repro here https://github.com/threepointone/test-wrangler-vite-spa-routing-patterns, but including the results in this issue as well.
Assume we have an assets directory that looks like this:
with a configuration (as in wrangler.jsonc) that looks like this:
{ // ... "assets": { "directory": "public", "not_found_handling": "single-page-application" } }Here's a table of paths, expected files to be loaded, and what files actually get loaded.
Please provide any relevant error logs
No response