Reputation: 11
I'm using server rendered pages in NextJS using getServerSideProps. It's in index.js (root page). When I'm making build locally, website working fine. But when i'm hosting this site in Vercel, it's showing 500 | Internal Server error.
export async function getServerSideProps(context) {
let params = context.query;
const job_col = await collection(db, "job_list");
const job_snap = await getDocs(job_col);
let jobData = job_snap.docs.map((doc) => ({
...doc.data(),
id: doc.id,
}));
return {
props: {
jobs: jobData,
params
},
};
}
Upvotes: 1
Views: 3589
Reputation: 1
I had the same issue. But when I changed getserversideprops to getstaticprops it worked.
Upvotes: -2
Reputation: 569
It's because of the large payload. Move the large payload code portion to the client-side(useEffect) and it will be resolved.
Upvotes: -2