Astro Info
Astro v4.15.8
Node v18.20.3
System Linux (x64)
Package Manager unknown
Output static
Adapter none
Integrations none
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
If I have a route like this:
/categories/[category]/
+-- index.astro
+-- [page].astro
In which each endpoint exports getStaticPaths, one for matching the base route with the category param, another for the category param with pagination.
If I include the following in astro.config.mjs:
// ...
redirects: {
'/categories/[category]': '/category/[category]/1',
},
// ...
Running astro build yields this error:
[ERROR] [build] Failed to call getStaticPaths for /categories/[category]
[GetStaticPathsRequired] `getStaticPaths()` function is required for dynamic routes. Make sure that you `export` a `getStaticPaths` function from your dynamic route.
What's the expected result?
I would expect this setup to build without errors. It's my understanding that configured redirects are supported in static render mode, and even if this isn't the case, the error doesn't make sense and took far too long to for me to track down the source of the problem.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/withastro-astro-vyvufy?file=src%2Fpages%2Findex.astro
Participation
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
If I have a route like this:
In which each endpoint exports getStaticPaths, one for matching the base route with the category param, another for the category param with pagination.
If I include the following in
astro.config.mjs:Running
astro buildyields this error:What's the expected result?
I would expect this setup to build without errors. It's my understanding that configured redirects are supported in static render mode, and even if this isn't the case, the error doesn't make sense and took far too long to for me to track down the source of the problem.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/withastro-astro-vyvufy?file=src%2Fpages%2Findex.astro
Participation