Skip to content
New issue

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

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

Already on GitHub? # to your account

Updated runtime so emitted Request type is compatible with Request from lib.dom.d.ts #2723

Closed
james-pre opened this issue Sep 17, 2024 · 0 comments · Fixed by #2738
Closed
Assignees
Labels
types Related to @cloudflare/workers-types

Comments

@james-pre
Copy link

#1383 Still seems like a common problem. In the issue, I show a solution to the problem. This solution involves a change to the emitted Request in @cloudflare/workers-types/index.d.ts:

  readonly redirected: boolean;
  readonly url: string;
-  readonly webSocket: WebSocket | null;
+  readonly webSocket?: WebSocket;
  readonly cf?: any;
}

It has been mentioned multiple times that these types are generated from the worker runtime. Can the worker runtime be updated so the emitted type changes as shown above? This would resolve many users' problems, without a significant change to the API or tooling.

@james-pre james-pre added the types Related to @cloudflare/workers-types label Sep 17, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
types Related to @cloudflare/workers-types
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants