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

75
Views
AbortController polyfill

Tried to make a polyfill for the abortController, but I ran into this error: error image

Error: Failed to execute 'fetch' on 'Window': Failed to read the 'signal' property from 'RequestInit': Failed to convert value to 'AbortSignal'.
class AbortSignalPolyfill extends EventTarget {
  readonly aborted: boolean = false
  onabort() {}
  addEventListener() {}
  removeEventListener() {}
}

class AbortControllerPolyfill {
  readonly signal = new AbortSignalPolyfill()
  abort() {}
}

;(function () {
  if (
    typeof window.Request === 'function' &&
    Object.prototype.hasOwnProperty.call(window.Request, 'signal') &&
    window.AbortController
  ) {
    return
  }

  Object.defineProperty(window, 'AbortController', {
    writable: true,
    enumerable: false,
    configurable: true,
    value: AbortControllerPolyfill,
  })

  Object.defineProperty(window, 'AbortSignal', {
    writable: true,
    enumerable: false,
    configurable: true,
    value: AbortSignalPolyfill,
  })
})()

Can anyone tell me why? Maybe the problem is in the abortControllerPolyfill and abortSignalPolyfill.

Thanks in advance!

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!