Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
fix: force browserify to load Buffer module (#1969)
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkmc authored and Alan Shaw committed Mar 30, 2019
1 parent 758d389 commit 3654e50
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ class IPFS extends EventEmitter {

module.exports = IPFS

Object.assign(module.exports, { crypto, isIPFS, Buffer, CID, multiaddr, multibase, multihash, multicodec, PeerId, PeerInfo })
// Note: We need to do this to force browserify to load the Buffer module
const BufferImpl = Buffer
Object.assign(module.exports, { crypto, isIPFS, Buffer: BufferImpl, CID, multiaddr, multibase, multihash, multicodec, PeerId, PeerInfo })

module.exports.createNode = (options) => {
return new IPFS(options)
Expand Down

0 comments on commit 3654e50

Please sign in to comment.