breaking: generate plaintext 404.html for Cloudflare Pages, instead of SPA-style fallback#11596
breaking: generate plaintext 404.html for Cloudflare Pages, instead of SPA-style fallback#11596Rich-Harris merged 5 commits intomainfrom
Conversation
…f SPA-style fallback
🦋 Changeset detectedLatest commit: 97aaa63 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
There was a problem hiding this comment.
Looks good! The issue has always been because of the wildcard exclude of our immutable assets and this solves that (albeit we don’t get the nice looking error page but it’s unlikely someone navigates to /_app/* anyway).
EDIT: For those using wildcards for their page routes, fallback should be opt-in as mentioned in #9762 (comment)
If someone was messing around with the _routes file they should be prepared to deal with the whole “generate fallback” and “if building” shenanigans anyway
RowanAldean
left a comment
There was a problem hiding this comment.
Looks functional, not ideal. Seems safe to merge.
benmccann
left a comment
There was a problem hiding this comment.
maybe a little weird to have one path that behaves differently, but really shouldn't matter. I'm fine with this if it helps simplify things
Alternative to #9762. Closes #9386. Instead of generating an SPA-style fallback page, we render a plaintext
Not Foundpage, which is sufficient for the case where a request is made for a missing asset that is covered by anexcluderule. For all other requests, we will hit the worker, which will generate the correct 404 page.Today:
With this PR:
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm testand lint the project withpnpm lintandpnpm checkChangesets
pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.Edits