ipfs / js-ipfs

IPFS implementation in JavaScript
https://js.ipfs.tech
Other
7.44k stars 1.25k forks source link

require$$2.bind is not a function after vite build, works during vite dev #4343

Closed boid-com closed 1 year ago

boid-com commented 1 year ago

Severity:

Critical - System crash, application panic.

Description:

Steps to reproduce the error:

Error trace

TypeError: require$$2.bind is not a function
    at ipfs.8f5ba8b6.js:17:314645
y @ index.cff37d5b.js:556
(anonymous) @ index.cff37d5b.js:556
Promise.catch (async)
$ @ index.cff37d5b.js:556
N @ index.cff37d5b.js:556
install @ index.cff37d5b.js:556
use @ index.cff37d5b.js:1
EM @ index.cff37d5b.js:556
await in EM (async)
(anonymous) @ index.cff37d5b.js:556
Promise.then (async)
(anonymous) @ index.cff37d5b.js:556
Promise.then (async)
(anonymous) @ index.cff37d5b.js:556
welcome[bot] commented 1 year ago

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review. In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment. Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

Finally, remember to use https://discuss.ipfs.io if you just need general support.

alan890104 commented 1 year ago

I solved this problem by upgrading vite to 4.3.3. Here is my repo.

SgtPooki commented 1 year ago

Hello @boid-com,

js-ipfs is being deprecated in favor of Helia. You can learn more about this deprecation and the corresponding migration guide here.

There is also an example of using helia with vite at https://github.com/ipfs-examples/helia-examples/tree/main/examples/helia-vite.

As a result, we are going to close this issue. If you think we have done this in error, please feel to reopen with any comments in the next week as we will circle back on the reopened issues.

We hope you will consider Helia for your IPFS in JS needs. If you believe this particular request belongs in Helia, feel free to open a Helia issue. We look forward to engaging with you more there.

Thanks, @ipfs/helia-dev