diff --git a/cloudflare/fetch/bind.go b/cloudflare/fetch/bind.go index 286c8b6d..5009b80f 100644 --- a/cloudflare/fetch/bind.go +++ b/cloudflare/fetch/bind.go @@ -15,8 +15,7 @@ func fetch(namespace js.Value, req *http.Request, init *RequestInit) (*http.Resp if namespace.IsUndefined() { return nil, errors.New("fetch function not found") } - fetchFunc := namespace.Get("fetch") - promise := fetchFunc.Invoke( + promise := namespace.Call("fetch", // The Request object to fetch. // Docs: https://developers.cloudflare.com/workers/runtime-apis/request jshttp.ToJSRequest(req),