web3.storage icon indicating copy to clipboard operation
web3.storage copied to clipboard

Module not found: Can't resolve 'ipfs-car/blockstore/memory' from web3.storage/src/platform.web.js

Open tomosaigon opened this issue 5 years ago • 10 comments

In the popular hackathon boilerplate scaffold-eth which uses Create React App, adding web3.storage to the React site results in a "Failed to compile" error with the reason being "Module not found: Can't resolve 'ipfs-car/blockstore/memory'" which is referenced from the file web3.storage/src/platform.web.js.

Create React App's react-scripts depends on webpack v4 and others have said web3.storage works with webpack v5 but not v4. For now this means popular packages like scaffold-eth and create-react-app won't work with web3.storage.

tomosaigon avatar Aug 05 '21 03:08 tomosaigon

Hi @tomosaigon I just tested in Create React App successfully - you should be able to use the prebuilt bundle like this:

import { Web3Storage } from 'web3.storage/dist/bundle.esm.min.js'

Please let me know if this doesn't work for you.

alanshaw avatar Aug 06 '21 10:08 alanshaw

I tried import { Web3Storage } from 'web3.storage/dist/bundle.esm.min.js' and that works fine

jaccos avatar Aug 08 '21 08:08 jaccos

Please let me know if this doesn't work for you.

Not Working

Udit-takkar avatar Nov 20 '21 18:11 Udit-takkar

+1 - does not work.

Cannot find module 'ipfs-car/blockstore/fs' from '/workspaces/collectorx/node_modules/web3.storage/dist/src/lib.cjs'

I'm trying to use web3.storage in my client app - so it needs to work with browserify.

aronchick avatar Nov 23 '21 21:11 aronchick

Did you both try importing the prebuilt bundle as mentioned above?

alanshaw avatar Nov 24 '21 07:11 alanshaw

thanks! didn't know if that would work in browser situations, but got info that we only support webpack. so switched over.

Would be great if this could be part of the docs, but since i moved on, we can punt on this for now.

(to be clear, i got here from Google, so this is linked via SEO)

aronchick avatar Nov 24 '21 23:11 aronchick

Also struggling with this: I tried: import { Web3Storage } from 'web3.storage/dist/bundle.esm.min.js' Keep getting this error image

adaOctopus avatar Nov 29 '21 21:11 adaOctopus

I'm also having the same problem with my React App.

  • Node 16.13.2
  • Yarn 1.22.17
  • React 17.0.1
  • react-scripts 4.0.3
  • web3.storage 3.1.0

I've tried with both import { Web3Storage } from 'web3.storage' and import { Web3Storage } from 'web3.storage/dist/bundle.esm.min.js'

natethor avatar Feb 19 '22 19:02 natethor

almost same exact setup as above. any fixes here?

dlazares avatar Feb 28 '22 19:02 dlazares

Hi @tomosaigon I just tested in Create React App successfully - you should be able to use the prebuilt bundle like this:

import { Web3Storage } from 'web3.storage/dist/bundle.esm.min.js'

Please let me know if this doesn't work for you.

Thanks it worked for me.

nirban256 avatar Mar 22 '23 13:03 nirban256