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

158
Vistas
timeoutSignal not working with node-fetch server side

I am trying to upgrade my node-fetch with the instructions here: https://github.com/node-fetch/node-fetch/blob/HEAD/docs/v3-UPGRADE-GUIDE.md

I am able to get it to work and return a result when I don't set the signal option. I am not able to get the timeout working using timeoutSignal. https://github.com/node-fetch/timeout-signal

    
    const signal = timeoutSignal(5000); // This returns and empty AbortSignal object

    // setting this causes an error, the fetch works without it
    _.set(
      opts,
      'signal',
      signal
    );

    const fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args));

    fetchedResponse = await fetch(url, opts)
      .then(response => {
        console.log(response);
        return response;
      })
      .catch(error => {
        console.log(error);
      })

If I change the property name 'signal' to anything else like 'signal-disable' or just remove it, everything works (without a timeout). The issue is that 'timeoutSignal(5000)' is returning an empty 'AbortSignal' object.

In the examples that I see, timeoutSignal seems to be always used in a client side scenario. I am not sure if this will work server side and can't find any examples.

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