Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

236
Views
getServerSideProps giving error request time out after deployment
export async function getServerSideProps(context) {
    const docRef = doc(db, "chats", context.query.id);
    const messagesRes = await getDocs(query(collection(docRef, "messages"), orderBy('timestamp','asc')));
    const messages = messagesRes.docs.map((doc) => ({
     id: doc.id,
     ...doc.data(),
   }))
   .map((messages) => ({
     ...messages,
     timestamp: messages.timestamp.toDate().getTime(),
   }));

   const chatRes = await getDoc(docRef);
   const chat = {
    id: chatRes.id,
    ...chatRes.data()
   }
   return {
     props: {
       messages: JSON.stringify(messages),
       chat: chat,
     },
   };
}

This is my code for fetching the data from Firestore and using the data for populating my pages before rendering on web pages. This works fine when I am using in localhost before deployment, But after deployment on Vercel, it is taking too much time to render the pages on-screen and then shows request time out on screen. And an error in the function logs below:-

Some errors in function logs on Vercel:

some errors in function logs on vercel

Can anybody tell me why I am getting this error after deployment as it works fine before deployment. Below I am also attaching the link to the project https://chitzzapp.vercel.app/

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!