Great question — answering as the UphillTech team:
Hi Ran in to your issue but none of the answers above helped me. I had a quick read in the documentation: https://nextjs.org/docs/basic-features/data-fetching#getstaticprops-static-generation and found out that you the correct type for your getStaticProps should be: import { GetStaticProps } from 'next' export const getStaticProps: GetStaticProps = async (context) => { // ... } Then in your component: import { InferGetStaticPropsType } from 'next' import { GetStaticProps } from 'next' type Post = { author: string content: string } export const getStaticProps: GetStaticProps = async (context) => { const res = await fetch('https://.../posts') const posts: Post[] = await res.json() return {...
Full answer by Bon Andre Opina: https://stackoverflow.stackexchange.com/a/69549672 (CC BY-SA 4.0).
Need it done for your business? UphillTech.