You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently encountered a type mismatch issue while writing test code for Cloudflare Worker's DurableObject by @cloudflare/vitest-pool-worker. The problem arises due to the fetch method being undefined, following the example provided in honojs/examples for creating a DurableObject.
Type 'MatchmakingDurableObject' does not satisfy the constraint 'DurableObject'.
Types of property 'fetch' are incompatible.
Type '((request: Request<unknown, CfProperties<unknown>>) => Response | Promise<Response>) | undefined' is not assignable to type '(request: Request<unknown, CfProperties<unknown>>) => Response | Promise<Response>'.
Type 'undefined' is not assignable to type '(request: Request<unknown, CfProperties<unknown>>) => Response | Promise<Response>'.ts(2344)
Notes
This commit of the example is just 1 week ago, so I know this is the new error. honojs/examples@9b7acf1
Temporarily I just define the fetch method on the DurableObject for the test, strangely.
The text was updated successfully, but these errors were encountered:
Abstract
I recently encountered a type mismatch issue while writing test code for Cloudflare Worker's DurableObject by
@cloudflare/vitest-pool-worker
. The problem arises due to the fetch method being undefined, following the example provided in honojs/examples for creating a DurableObject.Packages
Codes
src/Matchmaking.ts
test/Matchmaking.spec.ts
tsconfig.json
test/tsconfig.json
Error log on vscode
Notes
This commit of the example is just 1 week ago, so I know this is the new error.
honojs/examples@9b7acf1
Temporarily I just define the fetch method on the DurableObject for the test, strangely.
The text was updated successfully, but these errors were encountered: