We’re using Next.js to deploy our pages, and I’m running into a hydration error. Currently, I’m using getServerSideProps. When I console.log, I can see the object. For example:
export const getServerSideProps: GetServerSideProps = async ({ params }) => {
const value = await getMyInformation()
console.log(value)
...
return {
props: {
page,
showroomSlug: value,
},
}
We’re passing the object through the data attribute like this:
<BuilderComponent model="page" content={page} data={{ showroomLocations }} />
On our page, we have two React components. When I console log the object inside this object on our server, the value is null.
const MyPageContainer = ({
...
value
}: MyPageContainerProps) => {
console.log('Directory', value)
Vercel Logs
Directory { showroomLocations: null }
On the other hand, when I replace getServerSideProps
with getStaticProps
, it works normally. However, if I use getStaticProps
, we sometimes get a too many request’s error during nextjs build.
I would like to know if the behavior in getServerSideProps
that sends null values initially on the server and updates it later is correct ?