olizilla/ipfs-get

Error getting cbor node

olizilla opened this issue · 0 comments

with some extra debug logging included. the object type needs handling.

$ echo '{ "name": "meat skeleton" }' | ipfs dag put                                                                                                                   
bafyreibprbybnngp4v7rrizi2vhfzrmqoaagngvmrj4vbgykyjhyqnwtai

$ ipfs-get bafyreibprbybnngp4v7rrizi2vhfzrmqoaagngvmrj4vbgykyjhyqnwtai                                                                                                
📡 Fetching .car file from http://127.0.0.1:5001/
bafyreibprbybnngp4v7rrizi2vhfzrmqoaagngvmrj4vbgykyjhyqnwtai {
  type: 'object',
  name: 'bafyreibprbybnngp4v7rrizi2vhfzrmqoaagngvmrj4vbgykyjhyqnwtai',
  path: 'bafyreibprbybnngp4v7rrizi2vhfzrmqoaagngvmrj4vbgykyjhyqnwtai',
  cid: CID(bafyreibprbybnngp4v7rrizi2vhfzrmqoaagngvmrj4vbgykyjhyqnwtai),
  node: Uint8Array(20) [
    161, 100, 110,  97, 109, 101,
    109, 109, 101,  97, 116,  32,
    115, 107, 101, 108, 101, 116,
    111, 110
  ],
  depth: 0,
  size: undefined,
  content: [AsyncGeneratorFunction: content]
}
TypeError [ERR_INVALID_ARG_TYPE]: The "chunk" argument must be of type string or an instance of Buffer or Uint8Array. Received an instance of Object
    at new NodeError (node:internal/errors:363:5)
    at _write (node:internal/streams/writable:312:13)
    at WriteStream.Writable.write (node:internal/streams/writable:334:10)
    at /Users/oli/Code/olizilla/ipfs-get/node_modules/stream-to-it/sink.js:71:20
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async extractCar (file:///Users/oli/Code/olizilla/ipfs-get/index.js:82:7)
    at async ipfsGet (file:///Users/oli/Code/olizilla/ipfs-get/index.js:61:3)