Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

750
Vistas
Error: How to serialize data from getStaticProps in Next.js

I am trying to fetch data from an Api but for sorry i've received this Error:

Server Error Error: Error serializing .results returned from getServerSideProps in "/". Reason: undefined cannot be serialized as JSON. Please use null or omit this value.

my code

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The props you're passing contain an object with a key of value undefined. A quick solution would be

return {
 props: {
   results: JSON.parse(JSON.stringify(request.results)); 
 }
}

JSON.stringify will remove those undefined values. You can try it out in your browser console: JSON.stringify({someKey:undefined})

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda