#Why I have an error in vercel while there is no error in local build?

2 messages · Page 1 of 1 (latest)

dry lotus
#

Hello, I'm trying to deploy my NextJS application on Vercel. But the application get crashed and here is the error

Error occurred prerendering page "/countries". Read more: https://nextjs.org/docs/messages/prerender-error

Error: Error serializing `.countries` returned from `getStaticProps` in "/countries".

I already read the doc, I feel I did everything there. Here is my code


export async function getStaticProps() {
  const res = await fetch(BASE_API_URL + '/countries', {
    headers: headers,
  })
  const result = await res.json()

  return {
    props: {
      countries: await result.response,
    },
  }
}

Would you please help me, I will be appreciated. Thanks!

sour ice
#

what is the type of .countries?