Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

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

Closed
lidel opened this issue May 22, 2019 · 3 comments · Fixed by ipld/js-ipld-dag-pb#142 or #2092
Closed

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

lidel opened this issue May 22, 2019 · 3 comments · Fixed by ipld/js-ipld-dag-pb#142 or #2092
Labels
exp/novice Someone with a little familiarity can pick up kind/bug A bug in existing code (including security flaws) P0 Critical: Tackled by core team ASAP status/ready Ready to be worked

Comments

@lidel
Copy link
Member

lidel commented May 22, 2019

  • Version: 0.36.0, prebuild browser bundle
  • Platform: web browser (Chrome & Firefox)
  • Subsystem: ipfs.add

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:

  • ipfs.add under 0.35.0 using Buffer: demo works ok
    • replace js-ipfs with 0.36.0 and it will fail
  • ipfs.add under 0.36.0 using File: demo fails
@alanshaw alanshaw added kind/bug A bug in existing code (including security flaws) exp/novice Someone with a little familiarity can pick up P0 Critical: Tackled by core team ASAP status/ready Ready to be worked labels May 22, 2019
@alanshaw
Copy link
Member

vmx added a commit to ipld/js-ipld-dag-pb that referenced this issue May 22, 2019
The code was wrong, it didn't actually use the keys of the object.
This also broke things in Browser environments.

Fixes ipfs/js-ipfs#2090.
@alanshaw
Copy link
Member

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

@vmx
Copy link
Member

vmx commented May 22, 2019

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

vmx added a commit to ipld/js-ipld-dag-pb that referenced this issue May 22, 2019
The code was wrong, it didn't actually use the keys of the object.
This also broke things in Browser environments.

Fixes ipfs/js-ipfs#2090.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
exp/novice Someone with a little familiarity can pick up kind/bug A bug in existing code (including security flaws) P0 Critical: Tackled by core team ASAP status/ready Ready to be worked
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants