SerializableError: Error serializing `.page`

Hello I am trying to use

and everything looks ok till i run the server i get this error

error - SerializableError: Error serializing .page returned from getStaticProps in “/[[…pages]]”.
Reason: undefined cannot be serialized as JSON. Please use null or omit this value.

and this is the code for the static props

export async function getStaticProps({
params,
}: GetStaticPropsContext<{ pages: string, locale: string }>) {

const page = await getPages(params?.pages)

return {
props: {
page,
locale: ‘en-US’,
},
revalidate: 24 * 60 * 60 * 60 // 1 día
}
}

i cant figure out whats tossing the error unless i am fully over seeing something

Hi @Beefy, Welcome to Builder.io Forum!

I have set up this example in my system and am not able to reproduce the issue. Could you please confirm if you’ve made any changes in the code?