-
-
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
🐛 BUG: Astro@0.19.1 doesn't redirect localhost:3000/
as an index file when using [...slug].astro
files
#1187
Comments
index.md
as an index file in [...slug].astro
fileslocalhost:3000/index
as an index file when using [...slug].astro
files
localhost:3000/index
as an index file when using [...slug].astro
fileslocalhost:3000
as an index file when using [...slug].astro
files
localhost:3000
as an index file when using [...slug].astro
fileslocalhost:3000/
as an index file when using [...slug].astro
files
At first glance I was thinking this was in the manifest, but on second thought this might be in the dev server. Probably not a “good first issue” if the source is unclear! But I’m guessing that once the source is identified it should be straightforward. |
Unfortunately from what I can tell this issue affects both the dev server and build time |
Thanks for the report! We believe that this has been fixed in astro v0.21, going out today. Let us know if you can still reproduce the issue after updating to v0.21 and we'll be happy to take a look. |
I hate to comment on something that is a year old but I can't find anyone else still having this issue. I have this exact issue when retrieving an index page from a CMS. For now a weak solution is to just use:
This results in a build output of It seems like maybe this was fixed and at some point has broken again? A recent version of Astro with the issue |
Hi @hayhaydz! If you're seeing this with a newer Astro version, a new issue with details would be super helpful. You can link to this one for reference if you like. |
What package manager are you using?
pnpm
What operating system are you using?
Linux
Describe the Bug
In #1184 I found that using Astro parameters together with
[...slug].astro
andgetStaticPaths
, with a param ofindex
, results in only being able to access index files with a url oflocalhost:3000/index
whilelocalhost:3000
give an error, e.g.My astro config file is,
Steps to Reproduce
pnpm i astro@^0.19.1 @astrojs/renderer-solid@^0.1.0 -D
astro.config.mjs
withmkdir src && cd src && mkdir pages && cd pages
echo "---" > [...id].astro
Add this to the
[...id].astro
fileastro dev
localhost:3000
to work, unfortunately I can't determine why it doesn't, however,localhost:3000/index
does workI created a CodeSanbox recreation: https://codesandbox.io/s/astro-getstaticpaths-index-redirect-grro5,
In order to clear the error you will need to add
/index
to the preview url, e.g. https://grro5.sse.codesandbox.io/indexLink to Minimal Reproducible Example (Optional)
No response
The text was updated successfully, but these errors were encountered: