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

205
Vistas
TypeError: Cannot read properties of null (reading 'toString') Next js

I've been trying to fix this problem for 2-3 days but I'm unable to fix it. It occurs when I try building the Application with yarn build here's the error

> Build error occurred
TypeError: Cannot read properties of null (reading 'toString')

my code-

export async function getStaticPaths(){
  // get the user's image from another table 
 

  const users = await prisma.UserInfo.findMany();
  const paths = users.map((user: any) => ({
    params: { pid: user.name},
    // Error: A required parameter (pid) was not provided as a string in getStaticPaths for /users/[pid].
  
  }))
  console.log(paths)
  return { paths, fallback: false }

}
export async function getStaticProps({ params }: any) {
  const user = await prisma.UserInfo.findUnique({
    where: {
      name: params.pid
    },
  });
  console.log(user)
  return { props: { user } };
}

any ideas on how to fix this? thanks Great day'

about 4 years ago · Juan Pablo Isaza
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