-
Notifications
You must be signed in to change notification settings - Fork 105
Closed
Description
(First of all thanks for this amazing package!)
We are using cross-fetch to use the same client calls to our APIs from other APIs and any running application.
For our infrastructural needs, we created a small customFetch function on top of the fetch function so we could change the URL if a cloud parameter is passed or not:
export const customFetch = (input: RequestInfo, init: RequestInit, cloud?: CloudSubdomain | string): Promise<Response> => {
let url = "";
if (cloud) {
url += createCloudUrl(cloud);
}
url += input;
return fetch(url, init);
};
After updating to version 3.1.0 our code started to throw the following error:
Type 'Promise<import("/home/user/development/node_modules/cross-fetch/lib.fetch").Response>' is not assignable to type 'Promise<Response>'.
Type 'import("/home/user/development/node_modules/cross-fetch/lib.fetch").Response' is not assignable to type 'Response'.
Types of property 'headers' are incompatible.
Type 'Headers' is missing the following properties from type 'Headers': [Symbol.iterator], entries, keys, values
22 return fetch(url, init);
I inspected the types from both node_modules/typescript/lib/lib.dom.d.ts and node_modules/cross-fetch/lib.fetch.d.ts and I see no difference apart from this:
declare var Headers: {
prototype: Headers;
new(init?: HeadersInit): Headers;
};
Hope you can shed some light on this.
Thanks for your time!
ebeloded
Metadata
Metadata
Assignees
Labels
No labels