-
-
Notifications
You must be signed in to change notification settings - Fork 41
Description
The cloudflare typings for the fetch seems to be different in cloudflare:
Example:
let response = await fetch(request, {
cf: {
// Always cache this fetch regardless of content type
// for a max of 5 seconds before revalidating the resource
cacheTtl: 5,
cacheEverything: true,
//Enterprise only feature, see Cache API for other plans
cacheKey: someCustomKey,
},
});```
In deno the following error occurs:
No overload matches this call.
Overload 1 of 2, '(input: string | URL | Request, init?: RequestInit | undefined): Promise', gave the following error.
Argument of type '{ cf: RequestInitCfProperties; }' is not assignable to parameter of type 'RequestInit'.
Object literal may only specify known properties, and 'cf' does not exist in type 'RequestInit'. Overload 2 of 2, '(input: string | URL | Request, init?: (RequestInit & { client: HttpClient; }) | undefined): Promise', gave the following error.
Argument of type '{ cf: RequestInitCfProperties; }' is not assignable to parameter of type 'RequestInit & { client: HttpClient; }'.
Object literal may only specify known properties, and 'cf' does not exist in type 'RequestInit & { client: HttpClient; }'.deno-ts(2769)```