Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

344
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda