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

103
Vistas
"next build" (create-next-app) not working when deploying to Vercel

I am running through an error while trying to deploy the app to Vercel. The issue mainly happens when trying to run next build because it is working fine on my localhost:3000. This is package.json

{
  "name": "foodrecipe",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "@contentful/rich-text-react-renderer": "^15.4.0",
    "contentful": "^9.0.3",
    "next": "11.1.2",
    "react": "17.0.2",
    "react-dom": "17.0.2"
  },
  "devDependencies": {
    "eslint": "7.32.0",
    "eslint-config-next": "11.1.2"
  }
}

This is the complete log:

enter image description here

enter image description here

These are getStaticPaths/props functions in [slug].js:


  const client = createClient({
    space: process.env.CONTENTFUL_SPACE_ID ,  
    accessToken:process.env.CONTENTFUL_ACCESS_KEY 
  })

  export const getStaticPaths = async()=>{
    const response = await client.getEntries({content_type:'recipesReactjs'})

    const paths = response.items.map(item =>{
      return{
        params:{slug: item.fields.slug}
      }
    })
    return{
      paths:paths,
      fallback:true, 
    }
  }

  export const getStaticProps = async(context)=>{ 
    const response = await client.getEntries({
      content_type:'recipesReactjs',
      'fields.slug':context.params.slug,
    })

    if(!response.items.length){
      return{
        redirect:{
          destination:'/', 
          permanant:false  
        }
      }
    }

    return{
      props:{myRecipe: response.items[0]},
      revalidate:1 , 
    }
  }

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