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

Type error on current HEAD #3527

Closed
vmx opened this issue Feb 4, 2021 · 1 comment · Fixed by #3529
Closed

Type error on current HEAD #3527

vmx opened this issue Feb 4, 2021 · 1 comment · Fixed by #3529
Labels
kind/bug A bug in existing code (including security flaws)

Comments

@vmx
Copy link
Member

vmx commented Feb 4, 2021

Severity: High

Description:

npm install errors. From the output I can't tell if it's a fatal error (and the installation actually works) or if it's an error that can be ignored.

I checked the source out and ran npm install. It failed with

> [email protected] prepare /tmp/js-ipfs/packages/ipfs-core
> aegir build --no-bundle

src/components/block/put.js:85:46 - error TS2345: Argument of type 'Uint8Array | Block' is not assignable to parameter of type 'Uint8Array'.
  Type 'Block' is missing the following properties from type 'Uint8Array': BYTES_PER_ELEMENT, buffer, byteLength, byteOffset, and 26 more.

85         const multihash = await multihashing(block, mhtype)
                                                ~~~~~


Found 1 error.

Command failed with exit code 2: tsc --build /tmp/js-ipfs/packages/ipfs-core/tsconfig-types.aegir.json
lerna info lifecycle [email protected]~prepare: Failed to exec prepare script

When I run $ npx aegir build --no-bundle directly in packages/ipfs-core, I get the same error. tsc is at version 4.1.3.

I expected that an npm install is successful.

Steps to reproduce the error:

$ git clone https://github.com/ipfs/js-ipfs 
$ cd js-ipfs
$ npm install
@vmx vmx added the need/triage Needs initial labeling and prioritization label Feb 4, 2021
@achingbrain
Copy link
Member

Looks like the types introduced by multiformats/js-multihashing-async#92 went out as a minor which has broken things.

achingbrain added a commit that referenced this issue Feb 4, 2021
The new types in multihashing-async are unsurprisingly stricter than
using no types at all.

fixes #3527
@achingbrain achingbrain added kind/bug A bug in existing code (including security flaws) and removed need/triage Needs initial labeling and prioritization labels Feb 5, 2021
achingbrain added a commit that referenced this issue Feb 7, 2021
The new types in multihashing-async are unsurprisingly stricter than using no types at all.

fixes #3527
oliveriosousa pushed a commit to oliveriosousa/js-ipfs that referenced this issue Jul 26, 2021
The new types in multihashing-async are unsurprisingly stricter than using no types at all.

fixes ipfs#3527
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug A bug in existing code (including security flaws)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants