What version of astro are you using?
1.6.10
Are you using an SSR adapter? If so, which one?
node
What package manager are you using?
npm
What operating system are you using?
Linux (WSL)
Describe the Bug
|
export type Params = Record<string, string | number | undefined>; |
says that
Astro.params can contain numbers, which
https://docs.astro.build/en/reference/api-reference/#params says doesn't actually happen. This forces TypeScript programs to either handle a
number type that never actually happens or to cast it away.
I believe #3087 introduced this in order to loosen typing in getStaticPaths(), which produces Params instances, but it broke consumption of the types. You probably need two different types for inbound vs outbound.
Run astro check in https://stackblitz.com/edit/github-fht7tc?file=src/pages/products/[name].astro to see the error.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-fht7tc?file=src/pages/products/[name].astro
Participation