We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
astro
2.5.1
None
pnpm
Mac
Safari
This looks to be a repeat of #6507 which was closed, though I'm still seeing the same behaviour.
The following code in src/pages/blog/[...page].astro doesn't infer props correctly, causing page in the snippet below to be typed as never.
src/pages/blog/[...page].astro
page
never
export const getStaticPaths = (async ({ paginate }) => { const posts = (await getCollection('blog')).sort( (a, b) => a.data.pubDate.valueOf() - b.data.pubDate.valueOf() ); return paginate(posts, { pageSize: 10 }) }) satisfies GetStaticPaths type Props = InferGetStaticPropsType<typeof getStaticPaths> const { page } = Astro.props as Props
I can work around this by manually typing the Props as follows, but it would be good to not to have keep doing this throughout the project.
interface Props { page: Page<CollectionEntry<'blog'>> }
Issue can be reproduced by running npm run check within the attached Stackblitz
npm run check
https://stackblitz.com/edit/github-xpiyfp?file=src%2Fpages%2Fblog%2F%5B...page%5D.astro
The text was updated successfully, but these errors were encountered:
Princesseuh
Successfully merging a pull request may close this issue.
What version of
astro
are you using?2.5.1
Are you using an SSR adapter? If so, which one?
None
What package manager are you using?
pnpm
What operating system are you using?
Mac
What browser are you using?
Safari
Describe the Bug
This looks to be a repeat of #6507 which was closed, though I'm still seeing the same behaviour.
The following code in
src/pages/blog/[...page].astro
doesn't infer props correctly, causingpage
in the snippet below to be typed asnever
.I can work around this by manually typing the Props as follows, but it would be good to not to have keep doing this throughout the project.
Issue can be reproduced by running
npm run check
within the attached StackblitzLink to Minimal Reproducible Example
https://stackblitz.com/edit/github-xpiyfp?file=src%2Fpages%2Fblog%2F%5B...page%5D.astro
Participation
The text was updated successfully, but these errors were encountered: