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

224
Views
La implementación de Nextjs falla con el backend de firebase (getStaticProps y getStaticPaths)

Estoy tratando de implementar mi sitio web nextjs en vercel. Estoy usando firebase como backend. Tengo una ruta dinámica y estoy usando getStaticProps y getStaticPaths para obtener los datos y completarlos.

La compilación siempre tiene éxito en el entorno local pero falla en vercel. Adjunto la captura de pantalla del error de compilación (aunque advierte, pero la compilación falla) y el código mínimo.

 export const getStaticPaths: GetStaticPaths = async () => { try { const builderCollection = collection(db, 'something') const builderSnapshot = await getDocs(builderCollection) const refs = [] builderSnapshot.forEach((doc) => { const data = doc.data() if (data && data.ref) { console.log('Store: Firebase path data', data.ref) refs.push(data.ref) } }) const paths = refs.map((ref: string) => { return { params: { ref, }, } }) return { paths, fallback: 'blocking' } } catch (error) { console.log(error) return { paths: [], fallback: 'blocking' } } } export const getStaticProps: GetStaticProps = async (context) => { try { const { ref } = context.params console.log('Store Ref:', ref) const builderCollection = collection(db, 'builder') const checkQuery = query(builderCollection, where('ref', '==', ref)) const checkerSnapshot = await getDocs(checkQuery) let fbData: DocumentData | null = null let id: string checkerSnapshot.forEach((doc) => { if (doc.exists()) { id = doc.id fbData = doc.data() } }) return { props: { data: fbData, id }, revalidate: 1, } } catch (error) { console.log(error) return { props: { data: null } } } }

No puedo depurar este error. He intentado aumentar el staticPageGenerationTimeout hasta 2000 segundos. Pero aún falla. Se lo agradezco mucho si alguien me puede ayudar. Gracias por adelantado.

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!