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.

toBuffer does not return a Buffer

See original GitHub issue

Not sure why but Packer.toBuffer() does not produce a Buffer.

buffer = await Packer.toBuffer(doc);
console.log(buffer instanceof Buffer); // false
console.log(Buffer.from(buffer) instanceof Buffer); // true

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
dolanmiucommented, Aug 15, 2019

No because it would break the Browser compatability of it

Browsers dont have the concept of Buffer

I’d say wrap that in your app

0reactions
jwerrecommented, Oct 13, 2019

Yes, I saw that. Wrapping it in a Buffer seems to work. Couldn’t you just add something like:

if( typeof Buffer !== 'undefined'){
    zipData = Buffer.from(zipData)
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

GraphicsMagick: toBuffer() Stream yields empty buffer
Here are some probable causes: Missing Installation: you did not install graphicsmagick or imagemagick correctly.
Read more >
Buffer | Node.js v19.3.0 Documentation
Creates and returns a new Blob containing a subset of this Blob objects data. The original Blob is not altered. blob.stream() #. Added...
Read more >
Buffer: All-you-need social media toolkit for small businesses
Use Buffer to manage your social media so that you have more time for your business. Join 160000+ small businesses today.
Read more >
Switching Buffers (GNU Emacs Lisp Reference Manual)
If buffer-or-name is nil , it defaults to the buffer returned by other-buffer (see The Buffer List). If buffer-or-name is a string that...
Read more >
Node.js Buffer.from() Method - W3Schools
An object to fill the buffer with. Legal object types: String Array Buffer arrayBuffer. encoding, Optional. If the object is a string, this...
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