Coder Social home page Coder Social logo

Comments (13)

lukehorvat avatar lukehorvat commented on May 2, 2024 1

Happy to report that as of stream-http v1.6.0, relative paths work when using got in the browser. 💪

from got.

sindresorhus avatar sindresorhus commented on May 2, 2024

Yeah, that seems like a bug in https://github.com/sindresorhus/prepend-http Will fix.

I didn't realize got works in the browser through browserify. That's awesome! I assume browserify shims the http module using XHR.

from got.

arthurvr avatar arthurvr commented on May 2, 2024

I didn't realize got works in the browser through browserify.

I didn't eighter. Super cool! If we can confirm everything works fine I'd even say that's a welcome addition to the readme?

from got.

sindresorhus avatar sindresorhus commented on May 2, 2024

Definitely!

from got.

kevva avatar kevva commented on May 2, 2024

@sindresorhus, they recently added better support for streams too for browsers that supports it. https://github.com/substack/node-browserify/blob/master/changelog.markdown#1100.

from got.

sindresorhus avatar sindresorhus commented on May 2, 2024

@lukehorvat Should be fixed now. Try reinstalling got ;)

from got.

floatdrop avatar floatdrop commented on May 2, 2024

This is relevant to - mdlavin/nested-error-stacks#6

from got.

lukehorvat avatar lukehorvat commented on May 2, 2024

Thank you @sindresorhus. 💃

from got.

lukehorvat avatar lukehorvat commented on May 2, 2024

Just having a play around with it now. It seems to send the request to http://localhost:8000./ping, which still isn't correct, but is close. It looks like http-browserify is the cause of the problem this time, so I will open an issue in that repo.

from got.

sindresorhus avatar sindresorhus commented on May 2, 2024

@lukehorvat Alright, paste in the link to the issue when you do so we can follow along.

from got.

lukehorvat avatar lukehorvat commented on May 2, 2024

@sindresorhus Okay, I've opened an issue here with an accompanying PR. Unfortunately there are 31 other pending PRs so I don't think it's going to get merged any time soon. 😐

from got.

bendrucker avatar bendrucker commented on May 2, 2024

http-browserify was replaced by https://github.com/jhiesey/stream-http in browserify@11

from got.

bendrucker avatar bendrucker commented on May 2, 2024

Also I'm gonna bring in @floatdrop's captureStackTrace ponyfill to nested-error-stacks in mdlavin/nested-error-stacks#6 instead of the naive initial solution I proposed. Right now got's not really compatible with browserify (b/c nested-error-stacks isn't). It'll work in Chrome, but any errors will result in an exception in a non-V8 browser (IE, Safari, Firefox).

from got.

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.