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

Closed
victorhahncastell opened this issue Feb 20, 2024 · 0 comments · Fixed by #2652
Closed
Labels
need/triage Needs initial labeling and prioritization

Comments

@victorhahncastell
Copy link

  • Version:
$ npm ls | grep libp2p
├── @chainsafe/[email protected]
├── @chainsafe/[email protected]
├── @libp2p/[email protected]
├── @libp2p/[email protected]
├── @libp2p/[email protected]
├── @libp2p/[email protected]
├── @libp2p/[email protected]
├── [email protected]
  • 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

Successfully merging a pull request may close this issue.

1 participant