question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

superagent.get(...).buffer is not a function

See original GitHub issue

installed through npm

Having trouble using simple buffer function.

const superagent = require('superagent');

superagent.get(url).buffer(true).parse(superagent.parse.image)
      .then((res) => res) 

results in superagent.get(...).buffer is not a function

Any help would be greatly appreciated, from all the guides and sample code I’ve read through, this should work fine.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:8

github_iconTop GitHub Comments

1reaction
niftylettucecommented, Jan 7, 2020

OK I see the issue.

In the older version, client version had this:

https://github.com/visionmedia/superagent/blob/v4.1.0/lib/client.js#L631-L635

In newer version, we have this:

Request.prototype.buffer = Request.prototype.ca;
Request.prototype.ca = Request.prototype.agent;

The order in the newer version when I did the rewrite got reversed. I’m fixing it now and publishing a new version.

0reactions
k-funkcommented, Jan 7, 2020

@niftylettuce 5.2.1 fixed the bug for me. Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

superagent.get(...).buffer is not a function · Issue #1517 - GitHub
Having trouble using simple buffer function. const superagent = require('superagent'); superagent.get(url).buffer(true).parse(superagent.parse.
Read more >
Superagent .attach() file or buffer data is empty - Stack Overflow
shows that superagent has its own FormData variable to which it appends attached ... fieldName) to get the request payload in JSON format....
Read more >
How to use the superagent.parse function in ... - Snyk
To help you get started, we've selected a few superagent examples, based on popular ways it is used in public projects. ; getArrayBuffer(url,...
Read more >
superagent.SuperAgentRequest.buffer JavaScript and Node ...
Best JavaScript code snippets using superagent.SuperAgentRequest.buffer(Showing top 10 results out of 315) · Most used superagent functions · Popular in ...
Read more >
superagent | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found