I’m encountering an issue with a file I uploaded to NFT Storage. It shows up in my NFT Storage files list, but when I click on the CID link to access it, I receive this error: ipfs cat /ipfs/bafyreiayui2us6fpowl42vqwmjrntpewhqpfkbgcak6pt4gkpz55z2o3se/: unknown node type.
Here’s the code I used to upload the file:
const { NFTStorage, File } = require('nft.storage')
const apiKey = 'eyJ........CJ9'
const client = new NFTStorage({ token: apiKey })
const metadata = await client.store({
name: artworkName,
description: description,
artistName: artistName,
image: new File(data, fileName, { type: artfile.mimetype }),
})
console.log(metadata.url)
I can see both the metadata.json and the uploaded file in my NFT Storage. I think the problem could be related to the file size. Can anyone provide some guidance on this?
I encountered a similar issue a few months back, and it often relates to how the file is processed during the upload. The ‘unknown node type’ error usually indicates a mismatch between the file content and what IPFS expects from the metadata. In your code, you’re using artfile.mimetype but passing data as the file content; if these do not match, or if your data buffer is corrupted, you may see this error. Ensure you log both the mimetype and the actual data buffer size before uploading to ensure they align. Additionally, be aware that NFT Storage can experience indexing delays; your file might upload successfully but may not fully propagate for a period. Consider waiting a few hours and then re-uploading. If the issue persists, try uploading a smaller test file with the same mimetype to determine if the issue lies with your specific file or the upload process.
hmm this is interesting… i’ve seen similar issues before and it’s not always about file size. that unknown node type error usually means something’s funky with how the data is being interpreted or stored.
what type of file are you uploading? image, video, or something else? and roughly how big is it?
when you see the file in your NFT Storage dashboard, can you actually preview it or does it just show up as a file entry? sometimes the upload completes but the file gets corrupted during transfer.
one thing that might help - try accessing the file through a different ipfs gateway. instead of the default one, try https://cloudflare-ipfs.com/ipfs/your-cid-here or https://gateway.pinata.cloud/ipfs/your-cid-here to see if it’s a gateway-specific issue.
what’s the actual file format and mimetype you’re working with? that might give us a clue about what’s going wrong with the node type detection.
Hit this same issue yesterday. Use ipfs dag get instead of ipfs cat - that error usually means you’re trying to cat a directory node, not a file. Your CID probably points to the directory structure, not the actual image file.