IPFS file upload succeeds but CID link returns node type error

I’m having trouble accessing my uploaded files through IPFS after using NFT Storage.

I successfully uploaded a file to NFT Storage and can see it listed in my files dashboard. However, when I try to access the file using the CID link, I get this error message: ipfs cat /ipfs/bafyreiayui2us6fpowl42vqwmjrntpewhqpfkbgcak6pt4gkpz55z2o3se/: unknown node type

Here’s the code I’m using to upload:

const { NFTStorage, File } = require('nft.storage')
const token = 'eyJ........CJ9'
const storage = new NFTStorage({ token: token })

const result = await storage.store({
   name: itemName,
   description: itemDescription,
   creator: creatorName,
   image: new File(fileData, imageName, { type: uploadedFile.mimetype }),
})
console.log(result.url)

Both the metadata.json and the actual file appear correctly in the NFT Storage interface. I suspect this might be related to the file size causing issues with IPFS retrieval.

Has anyone encountered this type of node error before? Any suggestions would be helpful.

had this exact issue last month! try using ipfs dag get instead of ipfs cat - ur CID is likely dag-cbor encoded, not just raw data. nft.storage wraps files in metadata, which leads to those weird node type errors when accessed directly.

NFT.storage wraps your file in a CAR structure instead of storing it directly. Your CID points to a directory with metadata and your actual file, not just the file itself. Try accessing it with /ipfs/your-cid/filename.jpg instead of the root CID. Run ipfs ls first to see what’s actually stored there. I hit the same issue when I started - NFT.storage auto-creates this wrapper but doesn’t make it obvious in their docs.

Oh interesting, sounds like a structure mismatch! Quick question though - when the file shows up correctly in the NFT Storage interface, can you actually download it from there?

Try accessing your CID through a gateway like https://gateway.pinata.cloud/ipfs/your-cid instead of command line. Web gateways sometimes handle DAG structure differently than local IPFS nodes.

What file type are you uploading? Some formats get weird with NFT.storage’s metadata wrapping. Try a simple text file and see if you get the same error.

Also, when you console.log that result.url, does it show a different structure than the CID you’re trying to cat?