Closed OxMarco closed 2 years ago
Hey @grcasanova have you tried this?
import { Web3Storage } from 'web3.storage/dist/bundle.esm.min.js'
yes but the library seems broken for newer nodejs versions
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
yes but the library seems broken for newer nodejs versions
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
Yeah facing same issue
Same issue here. Cannot make it work the nft.storage import. Anyone fixed it?
Same issue here. Cannot make it work the nft.storage import. Anyone fixed it?
yes but the library seems broken for newer nodejs versions
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
Same issue here. Cannot make it work the nft.storage import. Anyone fixed it?
Do you get this error when adding large files in Node.js?
No this error appears during the package installation phase
Same error here, already tried the suggested solution and fails, I need to be able to read Car files for my app :(
Same error.
Module not found: Can't resolve 'ipfs-car/blockstore/memory'
when added import { Web3Storage } from 'web3.storage/dist/bundle.esm.min.js'
getting heap out of memory error
I'm currently dealing with this issue as well
I'm currently having this issue too. Any progress?
Ok, guys I finally was able to fix the problem for me, so I paste my solution here hoping to help people in need.
For the team
Looks to me that if you remap the package export routes everything can run clean for all of us, if this is true please let me know because i'm flagging the whole package in order not to update it and keep my modifications to the map on the final build.
For people
Simple steps:
1_update to webpack 5, I followed this tut
2_Update the package.json of your project AND all routes in the webpack config.
3_create an npm "serve" script running both npm build and webpack serve command as explained in the tut.
4 _call the component with import { Web3Storage } from 'web3.storage/dist/bundle.esm.min.js'
in your App.js
This should do the magic for dev environment, when you build for production it throws an error:
Module not found: Error: Package path ./dist/bundle.esm.min.js is not exported from package \source\repos\webpack5\node_modules\web3.storage (see exports field in \source\repos\webpack5\node_modules\web3.storage\package.json)
And here's the problem with the map. I changed the exports map with the suggested package route directly into the node_module folder web3.storage, name of file is package.json, that's why i won't be able to update anymore without losing this change, needed for the final react build. this is how my exports look like now:
"exports": { ".": { "browser": "./src/lib.js", "require": "./dist/src/lib.cjs", "node": "./src/lib.js" }, "./src/platform.js": { "browser": "./src/platform.web.js", "require": "./dist/src/platform.cjs", "node": "./src/platform.js" }, "./name": { "browser": "./src/name.js", "require": "./dist/src/name.cjs", "node": "./src/name.js" }, "./dist/bundle.esm.min.js": { "browser": "./dist/bundle.esm.min.js", "require": "./dist/bundle.esm.min.js", "node": "./dist/bundle.esm.min.js" } },
Hope this helps someone, or if I'm doing wrong hope someone from the team will tell me to stop immediately because I'm doing something very dangerous that i didn't recognise.
Cheers
Do this: add into your types "declare module 'nft.storage/dist/bundle.esm.min.js';"
still facing this issue
still facing this issue
yeah, i opened another issue to address it further, but it doesn't look like people are interested in fixing at the moment... #1301
The import line
import { Web3Storage, getFilesFromPath } from 'web3.storage';
leads to the error Module not found: Can't resolve 'ipfs-car/blockstore/memory' on ReactJS.I know this issue has been mentioned here #312 and here #343 but it seems it hasn't been solved yet.