Closed jornki closed 2 years ago
This is related to #1187
I was able to replicate this here: https://codesandbox.io/s/astro-1322-reproduction-48dld?file=/src/pages/subfolder/%5B...slug%5D.astro
Can confirm that the HTML is built only on build, but not when using the dev server.
Looks like this was fixed along the way post v0.21 🎉
Repro I threw together to confirm in the lastest Minimal
template: https://stackblitz.com/edit/github-my7zu2?file=src/pages/blog/[...slug].astro
What package manager are you using?
npm
What operating system are you using?
Mac
Describe the Bug
When generating a pages using rest parameters the page will fail with a 404 when running in the dev server. However, when building the project the page is correctly being generated (and works fine with preview).
Structure
/pages /pages/subfolder/[...slug].astro
The page
/pages/subfolder/[...slug].astro
is generating output pages in multiple sub-levels. The date of the content for the page is being used to construct the path. For instance/subfolder/2021/09/05/name-of-page/index.html
.When running
astro build
the expected files will be created and everything works. However, when running the dev server all generated pages will fail with a 404.getStaticPaths
The paths are generated to create subfolders (as seen above) using the year, month and date in this case.
Steps to Reproduce
npm init astro
(using Typescript)Link to Minimal Reproducible Example (Optional)
No response