-
Notifications
You must be signed in to change notification settings - Fork 557
Closed
Labels
typesRelated to @cloudflare/workers-typesRelated to @cloudflare/workers-types
Description
In the latest workers-types release, some return types are being typed as ArrayBufferView instead of string, such as the getters on URL objects.
Reference: https://npmdiff.dev/@cloudflare%2fworkers-types/4.20240222.0/4.20240312.0/package/2023-07-01/index.d.ts/
Or full source diff: Cloudflare-Mining/Cloudflare-Datamining@f3eb65c

Previously worked:
export default {
async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
const url = new URL(request.url);
const urlWithHostname = url.hostname + url.pathname;
return new Response(urlWithHostname);
},
};Now it errors with:
Operator '+' cannot be applied to types 'ArrayBufferView' and 'ArrayBufferView'.ts(2365)
This also impacts getters on URLSearchParams. I would guess these unintentional changes are due to some of the changes with ada url implementation, but I'm not confident.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
typesRelated to @cloudflare/workers-typesRelated to @cloudflare/workers-types