Coder Social home page Coder Social logo

Breaks superagent about bitgojs HOT 10 CLOSED

bitgo avatar bitgo commented on August 16, 2024
Breaks superagent

from bitgojs.

Comments (10)

olalonde avatar olalonde commented on August 16, 2024

Nevermind! the problem was with another module

from bitgojs.

olalonde avatar olalonde commented on August 16, 2024

Oh the issue is that both bitgojs and my tests are using the supertest-as-promised module and this hangs one of my test for some reason.

from bitgojs.

olalonde avatar olalonde commented on August 16, 2024

Ah, I guess this is the problem:

superagent.Request.prototype.end = function() {

from bitgojs.

olalonde avatar olalonde commented on August 16, 2024

Requiring Bitgo will break any app that uses superagent, maybe there would be a more elegant way to do this than patching superagent globally?

from bitgojs.

bpdavenport avatar bpdavenport commented on August 16, 2024

Thanks for debugging. Is there a way you can work around this for the moment? Is bitgo not installing its own version of superagent, because you have it installed as a peer dependency? Can you force bitgo to install its own superagent that would then not conflict? Perhaps maybe if we changed the version from ^1.4.0 to "1.4.0", then you could depend on a different version, which would force it to be installed.

from bitgojs.

bpdavenport avatar bpdavenport commented on August 16, 2024

We will look at how to make this cleaner, but it may take a bit.

from bitgojs.

olalonde avatar olalonde commented on August 16, 2024

Yes, it's using the superagent I have already npm installed.

$ node --version
v6.0.0
$ npm --version
3.8.6

from bitgojs.

olalonde avatar olalonde commented on August 16, 2024

As a quick fix, I think changing ^1.4.0 to "1.4.0" or if you published a fork of superagent under bitgo-superagent

from bitgojs.

olalonde avatar olalonde commented on August 16, 2024

FWIW, Superagent will ship with promises soon: ladjs/superagent#925 (not on npm yet though)

from bitgojs.

olalonde avatar olalonde commented on August 16, 2024

@bpdavenport this should fix my problem for now: #24 but ideally it would be better if bitgo didn't monkey patch superagent :)

from bitgojs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.