web3-storage / web3.storage

DEPRECATED ⁂ The simple file storage service for IPFS & Filecoin
https://web3.storage
Other
504 stars 119 forks source link

Creating a client instance gives "TypeError: mergeOptions__default.default.bind is not a function" #471

Closed jjranalli closed 3 years ago

jjranalli commented 3 years ago

I have encountered this error in my Nextjs app while creating a client instance of Web3Storage, using the constructor specified in the docs.

import { Web3Storage } from 'web3.storage'

const client = new Web3Storage({ token: apiToken })

(Next v11.1.0, Node v14.16.1)

The following issue might be related https://github.com/ipfs/js-ipfs/issues/3838 however reinstalling dependencies as suggested by the author of the issue doesn't fix it in my case.

jjranalli commented 3 years ago

Reproduction repo (created by @max-andrew): https://github.com/max-andrew/web3-storage-test

jjranalli commented 3 years ago

Closing this as the error seems to be related to the js-ipfs-unixfs dependency which introduced the issue in v9.0.5.

As a temporary fix, manually install js-ipfs-unixfs v9.0.4 latest version (^9.0.6) now that it's been fixed.