Comments (5)
@naftalimurgor Yeah, it was puzzling to me as well. In any case, I was able to find a workaround and hopefully this works for you as well. Instead of using this library, I've removed it an am now just using the NFT Storage API. Before, I was doing something like this:
const cid = await client.storeBlob(new Blob([file]))
Now I'm doing this:
const { body } = await got.post('https://api.nft.storage/upload', {
headers: { Authorization: `Bearer ${YOUR_API_KEY}` },
body: file,
})
const cid = JSON.parse(body).value.cid
Note: I'm using got as my HTTP library, but you can use node-fetch, Axios, or whatever http tooling you prefer.
Hope this helps!
from carbites.
In other cases we've found the problem to be because the library is being bundled with webpack 4.
Webpack 4 does not support package.json
exports
field so is unable to resolve the dependency.
If you can't upgrade to webpack 5, you can use the prebuilt library:
import { NFTStorage } from 'nft.storage/dist/bundle.esm.min.js'
from carbites.
Wow, thanks for the insight. Let me try to using that approach. Will let you know in case of any issues.
from carbites.
My team is also running into this issue as well (node@16), which I believe is because carbites
is an ESM-only library. Our build can't resolve the module.
from carbites.
@jakerainis At first I thought it was a problem a problem with Nodejs version. Has your team been able to upload the NFT artifacts using any other means? I'm looking to upload over 1200 images but can't seem to wrap my head around this issue yet.
from carbites.
Related Issues (13)
- support incomplete CAR files HOT 1
- Cron Package - Continuous Deployment
- GH Action (Continuous Deployment)
- feat: Allow migration of upload history from one account to another HOT 1
- Add @ipld/dag-json encoder by default HOT 4
- Tree walk splitter can throw error getting the block links HOT 1
- Getting error when trying to install carbites HOT 3
- Error: Cannot find module 'carbites/treewalk' HOT 4
- Guardrails around Pinning Service API HOT 1
- Optimize new Web3.Storage gateway for nft.storage retrieval for better performance
- Error: Cannot find module 'carbites/treewalk' HOT 7
- Research how to speed up gap fill HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from carbites.