rarepress
rarepress copied to clipboard
cid.startsWith is not a function
C:\Users\dimpa\node_modules\nebulus\index.js:147
const filePath = (cid.startsWith("/ipfs/") ? ${this.storage}${cid} : ${this.storage}/ipfs/${cid})
^
TypeError: cid.startsWith is not a function at Network.upload (C:\Users\dimpa\node_modules\nebulus\index.js:147:27) at async C:\Users\dimpa\Documents\KalpProjectsCoding\generateNFT\index.js:16:9
This happened to me, the Buffer you are using to create the file and get the cid is null, if you are using fs.readfile, the first argument is the error, the second one are the actual bytes, so make the callback function like this (err, bytes) =>