Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

342
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!