Created
June 17, 2026 14:00
-
-
Save rockwotj/a629eea7b9ccbd7e354659b9f09fead3 to your computer and use it in GitHub Desktop.
teeny-request ERR_STREAM_UNABLE_TO_PIPE reproduction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const nock = require('nock'); | |
| const {teenyRequest} = require('teeny-request'); | |
| nock.disableNetConnect(); | |
| nock('https://example.com').get('/').reply(200, 'ok'); | |
| process.once('unhandledRejection', error => { | |
| console.error(error); | |
| process.exitCode = 1; | |
| }); | |
| const stream = teenyRequest({uri: 'https://example.com'}); | |
| stream.once('response', response => { | |
| response.body.once('close', () => console.log('response body closed')); | |
| stream.destroy(); | |
| }); | |
| stream.resume(); | |
| setTimeout(() => console.log('finished'), 100); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment