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

169
Visualizações
Revert window.Promise back to native

I have a JS library (lets call it library 'a') which is an angular app component and is served through a CDN. I also have another library (let call it library 'b') which was written in typescript and transpiled down to es6.

I am loading both these libraries inside of a .Net MVC Knockoutjs application. I am facing an issue, when I load library 'a' it modifies native promises, and library 'b' relies on native promises to perform operations inside it.

If I remove library 'a' from the page and only load library 'b' it works fine.

When I only load library 'b' this is what window.Promise looks like -

enter image description here

When I load library 'a' this is what window.Promise looks like -

enter image description here

And after loading library 'a' if I load library 'b', the Promises inside this library 'b' begins to fail. Seems like all instanceof Promise evaluate to false even if it is a Promise

See below - enter image description here

This is from library 'b'

I am loading these libraries on a user click and add it to DOM using jquery $getScript('', ()=> {})

I am wondering, if there's a way to revert window.Promise back to the native, when I am about to load library 'b'

I am pretty new to Promises, any help is appreciated.

Thanks.

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