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

Uncaught TypeError: bytes is undefined #3915

Closed
@negamaxi

Description

@negamaxi
  • Version: ipfs-core 0.11.1
  • Subsystem: cids ?

Severity: Hight

Description:

As I use ipfs in browser app I've decided to switch to ipfs-core package, but it breakes my app here:

// import { CID } from "ipfs"; <-- This one works
import { CID } from "ipfs-core"; // <-- This one doesn't work

const cidString = 'bafyreib6nqpbzovgi3xmzzcfjpaps6ftaq2vgvbjto6ag3eqmkckhsug3m'

const cidInstance = new CID(cidString); // <-- This line throws an Uncaught TypeError: bytes is undefined

const { value } = await ipfs.dag.get(cidInstance);

I am able to fix this by using CID constructor directly from cids though:

// import { CID } from "ipfs"; <-- This one works
// import { CID } from "ipfs-core";  <-- This one doesn't work
import CID from "cids"; // <-- This one works

ipfs package version I'm switching from: "0.55.4"
ipfs-core core package version I'm switching to: "0.11.1"
cids package version: "1.1.7"

Metadata

Metadata

Assignees

No one assigned

    Labels

    need/triageNeeds initial labeling and prioritization

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions