-
Notifications
You must be signed in to change notification settings - Fork 286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Isomorphic fetch returns response with empty stream body #209
Comments
@y-chandra Hi, I have also encountered the same problem recently, did you find any fix for this ? |
I am encountering differences in behavior between isomorphic-fetch and the fetch available in my native node version. reponse.body.getReader is undefined when I use isomorphic-fetch. It's available when I the native fetch in node version 21 |
@pBread Were you able to find an alternative or work-around for this? Currently using node 18 but turning off node's fetch with I did notice that fetch is stable in node 21 - https://nodejs.org/docs/latest-v21.x/api/globals.html#fetch |
@nsunga, I was trying to replace this hacky code w/ let isNode = false;
async function initializeFetch() {
if (typeof window === 'undefined' ||
typeof globalThis.fetch === 'undefined') {
const nodeFetch = await import('node-fetch');
fetch = nodeFetch.default;
isNode = true;
} else {
fetch = globalThis.fetch;
}
} |
Hi team - After updating to NodeJs 18, we've started to see an issue where making an HTTP request using isomorphic-fetch to a url that returns streamed response returns a response with an empty stream even though the status returned is 200. Sharing the screenshots for the responses on NodeJS < 18 vs NodeJs >=18
Response returned on NodeJS < 18
Response returned on NodeJs >= 18
The text was updated successfully, but these errors were encountered: