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

342
Vistas
error UNHANDLED REJECTION ENOENT: no such file or directory, open '/vercel/path0/.cache/json/

I m running a fetch request inside of a for loop, the API I'm fetching it's a heroku server that scrapes data and sends it back with res.json(). The heroku server is a free version. The code failing in the gatsby-node (async createPages) is shown down below


const laro = await graphql(`{
 links {
  results 
  }
}
`)

await laro.data.links.results.forEach( async kok => {
   try {
   let luca = await kok.split("/")[4]
   let rollot = await fetch(
   `https://sheltered-meadow-66603.herokuapp.com/noti/${luca}`)

 await createPage({
 path: `/${luca}/`,
 component: abruNews,
 context: {
 data: rollot,
 },
})
} catch (err) {
  console.log(err)
}
})

the error I'm getting is this

For more info and debugging tips: see https://gatsby.dev/sync-actions
File /vercel/path0/gatsby-node.js:232:14
230 | )
231 |
> 232 | return createPage({
| ^
233 | path: `/${luca}/`,
234 | component: abruNews,
235 | context: {
success Building production JavaScript and CSS bundles - 48.439s
success Rewriting compilation hashes - 0.001s
error UNHANDLED REJECTION ENOENT: no such file or directory, open '/vercel/path0/.cache/json/_abruzzo-esperienziale-un-viaggio-nei-cinque-sensi-nelle-terre-dei-briganti_.json'
Error: ENOENT: no such file or directory, open '/vercel/path0/.cache/json/_abr uzzo-esperienziale-un-viaggio-nei-cinque-sensi-nelle-terre-dei-briganti_.json'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! gatsby-starter-default@0.1.0 build: `gatsby build`
npm ERR! Exit status 1
npm ERR!

Thanks if you can help

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

A for loop (instead of a forEach) seems to be better ending every request and the error disappeared

about 4 years ago · Juan Pablo Isaza Denunciar
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