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

76
Visualizações
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
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