-
-
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
Dynamic folder routes ([...rest]/index.astro
) take precedence over index.astro
in 4.2.1
#9770
Comments
Yeah this regression exists in every release |
Reducing priority since a spread param in the middle of the path is unusual. We haven't officially supported it, explaining the absence of tests here. Description of the use-case they enable would help. |
It's the way I've preferred to organize my projects, separating colocated components into different folders. A
Due to this regression, I would need to organize in a flat structure like this:
Or by using hidden folders like this, which doesn't feel good:
I know that the Astro docs here suggest placing components in As evidence that I'm not the only one who prefers organizing like this, it would be similar to SvelteKit's filesystem routing. It's something which they believed in enough to make breaking changes to enforce. An excerpt from the link:
|
This isn't a similar issue. This is expected because In your case, you should have a file called From the docs:
|
@lilnasy
@ematipico I can understand that, if using spread params was not an approved or supported way of doing things, then it's technically not a regression. It would still be nice to be able to have this as a feature request, as it would make it much easier to colocate components with their routes and keep things organized. I'd even argue that any fully static route (e.g. |
That's a very neat way to organize! Thanks for explaining it so well. |
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Similar to #9724.
While a route of
[...rest].astro
was fixed with #9726, a route of[...rest]/index.astro
still overridesindex.astro
.What's the expected result?
The
index.astro
page should be displayed rather than[...rest]/index.astro
page. In the linked repro, the page should display "Index" but instead displays "Dynamic".Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-pqgx5b-azyze8?file=src%2Fpages%2F[...dynamic]%2Findex.astro
Participation
The text was updated successfully, but these errors were encountered: