Astro Info
Astro v5.11.0
Node v24.3.0
System Linux (x64)
Package Manager pnpm
Output static
Adapter none
Integrations @astrojs/svelte
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Astro.params has a wrong type. For example:
export function getStaticPaths() {
return [
{ params: { id: '1' } },
];
}
const { id } = Astro.params;
The IDE / TypeScript says id is a Number, but it’s actually a string.
What's the expected result?
TypeScript should infer the correct type. In this case, id should either be typed as a string or Astro.params.id should behave correctly and actually be a Number.
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-uqia3qvx?file=src%2Fpages%2F%5Bid%5D.astro
Participation
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Astro.paramshas a wrong type. For example:The IDE / TypeScript says
idis aNumber, but it’s actually astring.What's the expected result?
TypeScript should infer the correct type. In this case,
idshould either be typed as astringorAstro.params.idshould behave correctly and actually be aNumber.Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-uqia3qvx?file=src%2Fpages%2F%5Bid%5D.astro
Participation