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

Commit 3654e50

Browse files
dirkmcAlan Shaw
authored and
Alan Shaw
committed
fix: force browserify to load Buffer module (#1969)
1 parent 758d389 commit 3654e50

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/core/index.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,9 @@ class IPFS extends EventEmitter {
176176

177177
module.exports = IPFS
178178

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

181183
module.exports.createNode = (options) => {
182184
return new IPFS(options)

0 commit comments

Comments
 (0)