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.

README examples throw type errors #4072

@binarymonkee

Description

@binarymonkee
  • Version: 0.11.0
  • Subsystem: ipfs-http-client

Severity: Very Low

Description:

I tried using an instance of the https client using TS just like how it's in the docs. When I did create the instance my IDE complained about type errors.

Steps to reproduce the error:

I created the instance like this by looking at the README
const client = create("https://ipfs.provider.io:5001/api/v0");

This was the type error:

Type '"https://ipfs.provider.io:5001/api/v0"' has no properties in common with type 'Options'.ts(2559)

Turns out create() only accepts Options | undefined as params.
So I had to pass the URL like this:
const client = create({ url: "https://ipfs.provider.io:5001/api/v0" });

Should I raise a PR to update the examples in the README?

Metadata

Metadata

Assignees

No one assigned

    Labels

    exp/noviceSomeone with a little familiarity can pick upgood first issueGood issue for new contributorshelp wantedSeeking public contribution on this issuekind/bugA bug in existing code (including security flaws)topic/docsDocumentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions