-
Notifications
You must be signed in to change notification settings - Fork 2.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
[frameworks] Fix astro default routes since it is not SPA #8200
Conversation
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.
We need a way to have the redirects work but still have the 404 pages work, ideally leaving it to Astro to decide. Yesterday I did some research into it, and the problem is much larger in scope on the Astro side, I'll see if I can get a possible fix out, but if not this might be the only solution we have for now.
I'm going to close it for now. If it still makes sense to ship it, we can reopen. |
Hi everyone, Astro core maintainer here 👋 I was about to make a PR more or less identical to this and thought it might be best to discuss here first — maybe we can re-open. We currently document a weird hack in the Astro Vercel deploy guide, where setting There seems to be a bit of confusion between “SPA” mode and “SSR” in the discussion above, Astro doesn’t have an SPA-mode where you would route everything to In SSR mode, Astro’s adapter outputs routing configuration so I believe this
The answer here is no: if a user does not create a |
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 tried the example from the original PR #7747 as well as the latest example and both are SSG style, so I don't know why routes were added to begin with.
I discussed with @TooTallNate and we found that removing these routes (and fixing the asset header) would make astro work perfectly, thanks!
The default routes for Astro are redirecting all non-existing files to
index.html
, which means that the404.html
page is not used, and insteadindex.html
is shown for all not found pages.Astro outputs files for each page (ie.
about.html
,blog.html
, ...) so the{handle: 'filesystem'}
route should be enough to route all existing pages correctly.The missing part to ship this fix is to answer the following question: can we safely assume that Astro will always output a
404.html
file?Internal ref: https://github.com/vercel/customer-issues/issues/638