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

154
Views
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
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!