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

343
Vistas
NextJS/React component will not compile in development - no errors given

My dynamic route with NextJS will not finish compiling when I test it. It gets stuck and then is killed.

Here's my link route that leads to the dynamic page:

const options = props.response.data.map(r => (
            <Link href={`/games/${r.gameID}`}>
            <Flex key={r.gameID} borderWidth="1px">
                <Box p="2" as="button" borderWidth="1px">
                <Image
                    src={r.thumb}
                    alt={props.gameID}
                    width={{ md: 20 }}
                    height={{ md: 10 }} />
                </Box>
                <Spacer />
                <Box p="2">
                    <Text>{r.external} - {r.cheapest}</Text>
                </Box>
            </Flex>
            </Link>
        ))

This leads to my dynamic NextJS page called games that uses the [id] parameter in the URL. I call async getStaticPaths and getStaticProps shown below:

export async function getStaticPaths(){
    const router = useRouter()
    const gameID = router.query.id

    return {
        params: {
            id: gameID
        }
    }
}

export async function getStaticProps({ params }) {
    // Call an external API endpoint to get game data
    
    // Access route params:
    

    const response = await axios.get(`https://www.cheapshark.com/api/1.0/games?id=${params.id}`)
    const gameData = response.json()

    return {
      props: {
        data: gameData,
      },
    }
  }

Then I pass the gameData as a prop to the default exported function. Any ideas where I am going wrong?

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