workers types issue with Response
trying to make a simple websocket server with durable objects, passing the websocket as a ResponseInit parameter was causing issues, so I imported the types for DurableObject, Request, and Response from '@cloudflare/workers-types/experimental', that makes the typescript error go away, but when I try to run or deploy I get the following error:
No matching export in "node_modules/@cloudflare/workers-types/experimental/index.ts" for import "Response",
but the file clearly exports a Response class, any ideas?
3 Replies
Are you running or?
@HardlySpookin’ the first, just importing them as types gives a separate error since im using Response as a constructor
Yeah, that's the issue. The error above is saying that
Response
doesn't have an implementation, which is true, since @cloudflare/workers-types
only provides type definitions, not implementations.