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
Premature close #1219
Comments
@weijarz I'm not getting this error on 3.0.0-beta.10. This likely means that the connection is, in fact, closing prematurely. |
using pipeline results in weird behavior... I'm trying just basic stuff... And comparing what got have done... sindresorhus/got@7b2ccb0 I can't get this import https from 'https'
import Stream, {PassThrough, pipeline} from 'stream';
https.request('https://fex.baidu.com/feed.xml', async (res) => {
// res.on('data', (chunk) => {
// console.log(chunk.byteLength)
// })
// res.on('end', () => {
// console.log('end')
// })
// res.on('error', (err) => {
// console.log(err)
// })
// res.on('close', () => {
// console.log('close')
// })
console.log('Starts to read response')
await pipeline(
res,
new Stream.Writable({
write(chunk, encoding, callback) {
console.log('got data evt')
callback()
}
}),
(err) => {
if (err) {
console.error('Pipeline failed.', err);
} else {
console.log('Pipeline succeeded.');
}
}
)
console.log('Weird this is called before Pipeline succeeded')
}).end() Result:
Seems like got ignores the premuture close and continues as usual? Line 290 in b50fbc1
All responses dose not ends with |
@tekwiz
|
It sounds like Node.js 16 has fixed some of the chunked encoding problems. I'll do some more testing today. |
Just tried out this 4 on node 16.5 with d19fdac from #1222 ...And it seems to work fine now
That's grate news
@tekwiz I'm marking your PR as draft until you are done testing |
@weijarz Can you check if this issue is fixed with node-fetch@3.1.0? |
@tekwiz It has been fixed. |
I'm on 3.2.6 and I still see this. How do I get around it? |
3.2.8 same problem |
Ok, I solved that problem. Just migrated to node 18.6 https://nodejs.org/tr/blog/release/v17.5.0/ after 17.5.0 node js have native fetch |
There seems to be a regression. With node 16.15.1, node-fetch 3.1.0 works while more recent versions don't. I downgraded to 3.1.0 for as long as I have to keep using Node 16.x |
getting this in node 20.5.1, library version 2.6.12 |
If you folks are using an |
Seems fixed in |
Throws
The text was updated successfully, but these errors were encountered: