Skip to content

Instantly share code, notes, and snippets.

@rockwotj
Created June 17, 2026 14:00
Show Gist options
  • Select an option

  • Save rockwotj/a629eea7b9ccbd7e354659b9f09fead3 to your computer and use it in GitHub Desktop.

Select an option

Save rockwotj/a629eea7b9ccbd7e354659b9f09fead3 to your computer and use it in GitHub Desktop.
teeny-request ERR_STREAM_UNABLE_TO_PIPE reproduction
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