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

533
Visualizações
NextJS API resolved without sending a response

I am learning about getServerSideProps, I have a file 'hello.js' in pages/api/hello.js and the code is:

    function Hello({ data }) {
    return (
        <>
            <h1>{data}</h1>
        </>
    )
}
  
// This gets called on every request
export async function getServerSideProps() {
    // Fetch data from external API
    const res = await fetch(`https://ergast.com/api/f1/2021/drivers.json`)
    const data = await res.json()

    // Pass data to the page via props
    return { props: { data } }
}

export default Hello

I can't access the page due to the following error: API resolved without sending a response for /api/hello, this may result in stalled requests.

The code has been taken from here with a few tweaks: https://nextjs.org/docs/basic-features/data-fetching/get-server-side-props

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