-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
fix(vercel): include 404.html as fallback in the static adapter #9591
Conversation
🦋 Changeset detectedLatest commit: c7748f9 The changes in this PR will be included in the next version bump. 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 |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as off-topic.
This comment was marked as off-topic.
!preview 9591 |
Snapshots have been released for the following packages:
Publish Log
Build Log
|
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.
I can't believe you finally figured this out! Great job!
@@ -118,6 +118,11 @@ export default function vercelStatic({ | |||
continue: true, | |||
}, | |||
{ handle: 'filesystem' }, | |||
...routes.find(route => route.component.endsWith("/pages/404.astro")) ? [{ |
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.
Not blocking at all: is route.component
the right thing to check here? Seems like route.pathname?.endsWith('/404')
might be better?
Maybe we should expose if the site has a custom 404 page to adapters...
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.
Yeah we definitely should.
I would've been the happiest with an exact check for src/pages/404.astro
, but src
is configurable so this is the next best option.
Do you know off the top of your head whether pathname
is immune from configuration options, like trailingSlash
?
Was this a known issue? It was reported just yesterday. |
Changes
Testing
Added
static.test.js
along with a fixture.Docs
Does not affect behavior.