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

addEventListener has a broken type definition #318

Closed
vlovich opened this issue Nov 9, 2022 · 1 comment
Closed

addEventListener has a broken type definition #318

vlovich opened this issue Nov 9, 2022 · 1 comment

Comments

@vlovich
Copy link
Contributor

vlovich commented Nov 9, 2022

Previously this was fine:

addEventListener("fetch", (event: FetchEvent) => {
  event.respondWith(handle(event));
});

However with types 3.x it's failing because it expects the handler to accept Event and doesn't have overrides to tell it that registering with the literal 'fetch' event and a FetchEvent argument is acceptable.

@mrbbot
Copy link
Contributor

mrbbot commented Jan 19, 2023

Hey! 👋 I'm unable to reproduce this on the latest version of @cloudflare/workers-types@3. This should also be working in version 4 too. We're going to archive this repo now, so I'm going to close this.

@mrbbot mrbbot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants