Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript compilation errors within @libp2p/interface/src/event-target.ts #2420

Open
victorhahncastell opened this issue Feb 20, 2024 · 0 comments
Labels
need/triage Needs initial labeling and prioritization

Comments

@victorhahncastell
Copy link

  • Version:
$ npm ls | grep libp2p
├── @chainsafe/libp2p-noise@15.0.0
├── @chainsafe/libp2p-yamux@6.0.2
├── @libp2p/circuit-relay-v2@1.0.15
├── @libp2p/identify@1.0.14
├── @libp2p/mplex@10.0.15
├── @libp2p/webrtc@4.0.19
├── @libp2p/websockets@8.0.15
├── libp2p@1.2.3
  • Platform:
$ uname -a
Linux schnippi 5.15.0-92-generic #102~20.04.1-Ubuntu SMP Mon Jan 15 13:09:14 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
  • Subsystem:
    event-target.ts

Severity:

Low

Description / Steps to reproduce the error:

$ tsc
node_modules/@libp2p/interface/src/event-target.ts:94:71 - error TS2345: Argument of type 'CustomEventInit<Detail>' is not assignable to parameter of type 'CustomEventInit<Detail> & EventInit & { detail: Detail; }'.
  Type 'CustomEventInit<Detail>' is not assignable to type '{ detail: Detail; }'.
    Property 'detail' is optional in type 'CustomEventInit<Detail>' but required in type '{ detail: Detail; }'.

94     return this.dispatchEvent(new CustomEvent<Detail>(type as string, detail))
                                                                         ~~~~~~

node_modules/@libp2p/interface/src/event-target.ts:111:5 - error TS2578: Unused '@ts-expect-error' directive.

111     // @ts-expect-error could be undefined
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@victorhahncastell victorhahncastell added the need/triage Needs initial labeling and prioritization label Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need/triage Needs initial labeling and prioritization
Projects
None yet
Development

No branches or pull requests

1 participant