Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ipfs.object.put error #449

Closed
kenshyx opened this issue Apr 12, 2018 · 2 comments
Closed

ipfs.object.put error #449

kenshyx opened this issue Apr 12, 2018 · 2 comments
Assignees
Labels
kind/bug A bug in existing code (including security flaws) status/in-progress In progress

Comments

@kenshyx
Copy link

kenshyx commented Apr 12, 2018

Because of https://github.com/tableflip/ipfs-postmsg-proxy package, if I'm trying to add an object using the provided window.ipfs instance ex: ipfs.object.put({a:1}, (err, result) => console.log(err, result)) it will always fail with error:

Uncaught TypeError: _ipldDagPb.DAGNode.isDAGNode is not a function.

@lidel lidel self-assigned this Apr 12, 2018
@lidel lidel added kind/bug A bug in existing code (including security flaws) status/in-progress In progress labels Apr 12, 2018
@lidel
Copy link
Member

lidel commented Apr 12, 2018

Merged #448 which fixes issue with isDAGNode and released it as v2.2.1beta1. I'll release it to stable channel shortly.

@kenshyx Note that your snippet will still fail, as the object is not valid (missing Data field – see spec).
Try this instead:

ipfs.object.put({ Data: Buffer.from('Some data'), Links: [] }, (err, node) => {
  if (err) {
    throw err
  }
  console.log(node.toJSON().multihash)
  // Logs:
  // QmPb5f92FxKPYdT3QNBd1GKiL4tZUXUrzF4Hkpdr3Gf1gK
})

@lidel
Copy link
Member

lidel commented Apr 12, 2018

Fixed in v2.2.1

@lidel lidel closed this as completed Apr 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) status/in-progress In progress
Projects
None yet
Development

No branches or pull requests

2 participants