-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
breaking: generate plaintext 404.html for Cloudflare Pages, instead of SPA-style fallback #11596
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks functional, not ideal. Seems safe to merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 Found
page, which is sufficient for the case where a request is made for a missing asset that is covered by anexclude
rule. 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 test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. Changesets that add features should beminor
and those that fix bugs should bepatch
. Please prefix changeset messages withfeat:
,fix:
, orchore:
.Edits