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

Type helpers assigned to ipfs-http-client constructor #3450

Closed
dapplion opened this issue Dec 16, 2020 · 10 comments
Closed

Type helpers assigned to ipfs-http-client constructor #3450

dapplion opened this issue Dec 16, 2020 · 10 comments
Assignees
Labels
kind/bug A bug in existing code (including security flaws) kind/resolved-in-helia status/ready Ready to be worked

Comments

@dapplion
Copy link

dapplion commented Dec 16, 2020

Expected
The utilities assigned to the constructor should be typed as existing

Object.assign(ipfsClient, { CID, multiaddr, multibase, multicodec, multihash, globSource, urlSource })

Current
ipfsClient type does not include above utilities


"ipfs-http-client": "^48.1.2",
@dapplion dapplion added the need/triage Needs initial labeling and prioritization label Dec 16, 2020
@welcome
Copy link

welcome bot commented Dec 16, 2020

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment.
Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

  • "Priority" labels will show how urgent this is for the team.
  • "Status" labels will show if this is ready to be worked on, blocked, or in progress.
  • "Need" labels will indicate if additional input or analysis is required.

Finally, remember to use https://discuss.ipfs.io if you just need general support.

@achingbrain achingbrain added kind/bug A bug in existing code (including security flaws) status/ready Ready to be worked and removed need/triage Needs initial labeling and prioritization labels Dec 17, 2020
@achingbrain
Copy link
Member

Please can you try with the latest RC? ipfs-http-client has switched to named exports only so the utilities are no longer properties of the factory function:

$ npm install ipfs-http-client@next
const {
  create,
  CID,
  multiaddr
  // ..etc
} = require('ipfs-http-client')

const client = create()

console.info(await client.id())
// ..etc

@dapplion
Copy link
Author

dapplion commented Apr 1, 2021

Can I install this version's next without getting the following versions next if the package.json is left unchanged for a while?

@achingbrain
Copy link
Member

Not if you use next as the version number, but if you use the current RC version directly you'll aways get that version:

$ npm install ipfs-http-client@49.0.5-rc.3

Of course, if there's a subsequent RC you'll miss out on the changes.

@dapplion
Copy link
Author

dapplion commented Apr 1, 2021

@achingbrain Got

error ipfs-unixfs@4.0.1: The engine "node" is incompatible with this module. Expected version ">=14.0.0". Got "12.21.0"
error Found incompatible module.

You don't support node 12 anymore?

@achingbrain
Copy link
Member

You don't support node 12 anymore?

No, only Current and Active LTS - https://github.com/ipfs/community/blob/master/CONTRIBUTING_JS.md#supported-versions. Node 12 became Maintenance LTS at the end of last year.

@dapplion
Copy link
Author

dapplion commented Apr 1, 2021

No, only Current and Active LTS - https://github.com/ipfs/community/blob/master/CONTRIBUTING_JS.md#supported-versions. Node 12 became Maintenance LTS at the end of last year.

If possible do you know the last ipfs-http-client version that accepted node 12?

@achingbrain
Copy link
Member

The engines.node field of the current release (49.0.4) is >=10.3.0 so yarn will not error out if you try to install it on node 12.

It's possible you could transpile @next to be compatible with node 12 but if possible you should just upgrade.

@dapplion
Copy link
Author

dapplion commented Apr 1, 2021

The engines.node field of the current release (49.0.4) is >=10.3.0 so yarn will not error out if you try to install it on node 12.

Right, probably the issue is that the various dependencies are not synced on the node version required. In my case it was ipfs-unixfs@4.0.1 that blocked node 12

@whizzzkid
Copy link

whizzzkid commented May 31, 2023

js-ipfs is being deprecated in favor of Helia. You can follow the migration plan here #4336 and read the migration guide.

This issue has been resolved in Helia! if this does not address your concern please let us know by reopening this issue before 2023-06-05!

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) kind/resolved-in-helia status/ready Ready to be worked
Projects
No open projects
Status: Done
Development

No branches or pull requests

3 participants