ipfs / js-ipfs

IPFS implementation in JavaScript
https://js.ipfs.tech
Other
7.44k stars 1.25k forks source link

ipfs.add fails with TypeError: "can't convert undefined to object" #2090

Closed lidel closed 5 years ago

lidel commented 5 years ago

Type: Bug

Severity: High

Description:

ipfs.add with prebuilt bundle for use in browser produces error:

2019-05-22--14-46-42

Steps to reproduce the error:

I prepared two apps to demonstrate the issue:

alanshaw commented 5 years ago

https://github.com/ipld/js-ipld-dag-pb/blob/d02c65918e537380ad2844b2573283def30098b4/src/dag-node/addNamedLink.js#L14 should be Object.keys(object) not Object.keys(this).

alanshaw commented 5 years ago

@hugomrdias any chance you can look into why this wasn't caught in our browser tests?

vmx commented 5 years ago

I've opened https://github.com/ipfs/aegir/issues/362 to track the issue on Browser tests not running against the same code as the dist bundle contains.