From 24fabe050062cfac2a7f3bdc21e3ecf7ccd62cc8 Mon Sep 17 00:00:00 2001 From: Dirk McCormick Date: Fri, 29 Mar 2019 14:32:28 -0400 Subject: [PATCH] fix: force browserify to load Buffer module --- src/core/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/index.js b/src/core/index.js index 2076d7cee7..153f1a53cf 100644 --- a/src/core/index.js +++ b/src/core/index.js @@ -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)