-
-
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
Can't have any routes that start with index.
in subpaths
#12675
Comments
If you remove |
@matthewp unfortunately it does not. I renamed
Both links 404. Sorry for the late response, very busy week. |
Just commenting as a soft bump and to confirm that this bug persists in the latest Astro v5. I migrated the migration repo that I am currently working on to I'd appreciate it if someone can look into this as I cannot migrate to Astro if it will break existing links. |
@ericswpark I opened your reproduction, and it seems the issue is happening during be |
@ematipico this happens with both It seems like Astro, or some component of Astro, specially treats all files that start with |
I am not sure if your reproduction is the same as your project, but you're returning a Because of that, Astro doesn't create any file. I would argue that there's a bug where Astro creates a misleading log, but maybe this isn't your bug? |
@ematipico sorry, the reproduction might not exactly be the same. In my blog, the
Even when the This is what my source looks like pre-build: As you can see, Astro just ignores the |
Please, update the reproduction. We need a way to reproduce the bug 😅 |
Hello @ericswpark. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with |
I changed the reproduction to return a valid response, and I can see the files correctly emitted:
|
@ematipico please re-open. I was confused too for a second because StackBlitz was putting out It turns out that this breaks for subpaths. Please see this link: https://stackblitz.com/edit/github-99jtakub-y6r7uocq I've updated the issue title. Sorry for the confusion -- I didn't realize it had different behavior for root and subpath 😅 I can confirm the StackBlitz URL above has the correct repro as |
index
index.
in subpaths
The previous code would cause file names like `index.xml.ts` to be treated as index files, when they aren't (the file basename excluding the extension `.ts` is `index.xml`, and `index` should be the index file). To match index files only, match the entire first half of the basename when splitting by the last occurrence of the period/file extension delimiter. Pedantically this might not be correct -- i.e. some file extensions actually span multiple delimiters, like index.tar.gz. But in that case it's not an index file as well, so I think this is fine. Fixes withastro#12675
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Given the following
pages/
directory:Navigating to
blog/
will work (useindex.astro
), but navigating toblog/index.xml
will result in a 404.What's the expected result?
index*
files should map to other routes.Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-99jtakubstackblitz.com/edit/github-99jtakub-y6r7uocq
Participation
The text was updated successfully, but these errors were encountered: