-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Top level dynamic routes are prioritized #11394
Comments
Thanks for the issue @mrchantey. In the docs, what is meant by “static routes” are routes without any parameters (e.g. One thing I’m seeing with your reproduction is that if I build the project (I added the Node adapter to do this), the production site does serve Starlight’s pages before hitting the dynamic route. See https://stackblitz.com/edit/github-61gc9w-qyzhpu and then run I’m not 100% sure what the expected behaviour is here based on the docs, but hopefully it’s that the static pages always win and this is just a dev server bug. |
Oh awesome thats super helpful, yeah i hadn't tried a preview but noticed the static files in |
I chatted a bit with @Fryuni who implemented the routing priority rules in Astro and he said that unfortunately the dev server behaviour is the correct behaviour as currently specced. So technically it working in production with the Node adapter is a “bug” 😅 Seems a bit of a limitation to me, so we’ll chat to see if there’s a way to make this more easily configurable. To my mind users would always want a Starlight slug for which there is a content file to be served, and then their dynamic SSR routes to kick in. |
OK, moving this across to the main Astro repo for @Fryuni to think about how to handle best 🫡 |
@Fryuni any updates? |
What version of
starlight
are you using?0.24.5
What version of
astro
are you using?4.10.2
What package manager are you using?
npm
What operating system are you using?
Windows
What browser are you using?
Chrome
Describe the Bug
According to route priority order static files are prioritized over dynamic routes, however top level dynamic routes break starlight routes.
To see the effect click on the primary action button which redirects to a dynamic route.
An example use for this is github-style top level username routes:
[username]/[project].astro
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-61gc9w?file=src%2Fpages%2F%5Busername%5D%2F%5Bproject%5D.astro
Participation
The text was updated successfully, but these errors were encountered: