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
Description
- Version: ipfs-core 0.11.1
- Platform: Linux laptop 5.13.14-200.fc34.x86_64 Add to cli:
ipfs pin [-r] <ipfs-path>
#1 SMP Fri Sep 3 15:33:01 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux, Firefox 92.0
- 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"