Title: Errors thrown in `stream.pipeline` streams can get swallowed by `AbortError` · Issue #62089 · nodejs/node · GitHub
Open Graph Title: Errors thrown in `stream.pipeline` streams can get swallowed by `AbortError` · Issue #62089 · nodejs/node
X Title: Errors thrown in `stream.pipeline` streams can get swallowed by `AbortError` · Issue #62089 · nodejs/node
Description: Version v25.7.0 Platform Darwin MacBook.local 24.6.0 Darwin Kernel Version 24.6.0: Mon Jan 19 22:00:10 PST 2026; root:xnu-11417.140.69.708.3~1/RELEASE_X86_64 x86_64 Subsystem No response What steps will reproduce the bug? import fs from ...
Open Graph Description: Version v25.7.0 Platform Darwin MacBook.local 24.6.0 Darwin Kernel Version 24.6.0: Mon Jan 19 22:00:10 PST 2026; root:xnu-11417.140.69.708.3~1/RELEASE_X86_64 x86_64 Subsystem No response What steps...
X Description: Version v25.7.0 Platform Darwin MacBook.local 24.6.0 Darwin Kernel Version 24.6.0: Mon Jan 19 22:00:10 PST 2026; root:xnu-11417.140.69.708.3~1/RELEASE_X86_64 x86_64 Subsystem No response What steps...
Opengraph URL: https://github.com/nodejs/node/issues/62089
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Errors thrown in `stream.pipeline` streams can get swallowed by `AbortError`","articleBody":"### Version\n\nv25.7.0\n\n### Platform\n\n```text\nDarwin MacBook.local 24.6.0 Darwin Kernel Version 24.6.0: Mon Jan 19 22:00:10 PST 2026; root:xnu-11417.140.69.708.3~1/RELEASE_X86_64 x86_64\n```\n\n### Subsystem\n\n_No response_\n\n### What steps will reproduce the bug?\n\n```js\nimport fs from 'node:fs';\nimport { Readable, Transform } from 'node:stream';\nimport { pipeline } from 'node:stream/promises';\n\nexport async function main({ sourceStream, transformPushCount }) {\n await pipeline(\n sourceStream,\n\n new Transform({\n readableObjectMode: true,\n transform(chunk, encoding, callback) {\n for (let i = 0; i \u003c transformPushCount; i++) {\n this.push({});\n }\n callback();\n },\n }),\n\n (readable) =\u003e\n readable.map(async (obj) =\u003e {\n throw Error('Boom!');\n })\n );\n}\n\nif (import.meta.main) {\n try {\n await main({\n sourceStream: fs.createReadStream('/dev/urandom'),\n transformPushCount: 1,\n });\n } catch (e) {\n console.log(`sourceStream: file, transformPushCount: once, error: ${e}`);\n }\n try {\n await main({\n sourceStream: fs.createReadStream('/dev/urandom'),\n transformPushCount: 2,\n });\n } catch (e) {\n console.log(`sourceStream: file, transformPushCount: twice, error: ${e}`);\n }\n\n try {\n await main({\n sourceStream: Readable.from(['foo']),\n transformPushCount: 1,\n });\n } catch (e) {\n console.log(\n `sourceStream: readable from iterable, transformPushCount: once, error: ${e}`\n );\n }\n try {\n await main({\n sourceStream: Readable.from(['foo']),\n transformPushCount: 2,\n });\n } catch (e) {\n console.log(\n `sourceStream: readable from iterable, transformPushCount: twice, error: ${e}`\n );\n }\n\n try {\n await main({\n sourceStream: new Readable({\n read(size) {\n this.push('foo');\n },\n }),\n transformPushCount: 1,\n });\n } catch (e) {\n console.log(\n `sourceStream: readable implementation, transformPushCount: once, error: ${e}`\n );\n }\n try {\n await main({\n sourceStream: new Readable({\n read(size) {\n this.push('foo');\n },\n }),\n transformPushCount: 2,\n });\n } catch (e) {\n console.log(\n `sourceStream: readable implementation, transformPushCount: twice, error: ${e}`\n );\n }\n}\n```\n\n### How often does it reproduce? Is there a required condition?\n\nIt reproduces each time.\n\n### What is the expected behavior? Why is that the expected behavior?\n\nI would expect the pipeline call to be rejected with `Error: Boom!` in all cases shown in the example code.\n\n### What do you see instead?\n\n```plain\nsourceStream: file, transformPushCount: once, error: Error: Boom!\nsourceStream: file, transformPushCount: twice, error: AbortError: The operation was aborted\nsourceStream: readable from iterable, transformPushCount: once, error: Error: Boom!\nsourceStream: readable from iterable, transformPushCount: twice, error: Error: Boom!\nsourceStream: readable implementation, transformPushCount: once, error: AbortError: The operation was aborted\nsourceStream: readable implementation, transformPushCount: twice, error: AbortError: The operation was aborted\n```\n\n### Additional information\n\nThe example came out of a larger code that reads a CSV file, parses it to objects using the csv-parse library, and then uses `Radable.map` to call a third-party API concurrently for every parsed record. The API credentials I've been using expired, causing the pipeline to reject with `AbortError`, though I'd expect it to reject with 401 Unauthorized.","author":{"url":"https://github.com/hs-kgoriunov","@type":"Person","name":"hs-kgoriunov"},"datePublished":"2026-03-03T14:52:23.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/62089/node/issues/62089"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4355f615-089b-4850-effa-a8486ad25aa2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E0B2:76C74:6FA3FA:9F9C70:6A4CACA0 |
| html-safe-nonce | 71e91804f4a6d0e7014c32807ef3e69497bc27aff354fde078dd3f7d060ff6a0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMEIyOjc2Qzc0OjZGQTNGQTo5RjlDNzA6NkE0Q0FDQTAiLCJ2aXNpdG9yX2lkIjoiNTQ0MTM2NTgxNjUxNDQ4OTUwNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 9f41645386a0545378eb5a299fa149f0a84b269d79e0c2f68fc35725177295df |
| hovercard-subject-tag | issue:4017117395 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/62089/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0e29956cb9df9c8254c7f425d7110fab8a29b1f1b013e9047f98d8d520601c0e/nodejs/node/issues/62089 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0e29956cb9df9c8254c7f425d7110fab8a29b1f1b013e9047f98d8d520601c0e/nodejs/node/issues/62089 |
| og:image:alt | Version v25.7.0 Platform Darwin MacBook.local 24.6.0 Darwin Kernel Version 24.6.0: Mon Jan 19 22:00:10 PST 2026; root:xnu-11417.140.69.708.3~1/RELEASE_X86_64 x86_64 Subsystem No response What steps... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | hs-kgoriunov |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3d11bb817438277de2a940854450e83a7d32b6aeb5014e9e6b00a6423900251c |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ae90d426644ca15e89bacceb72e51f4e9dbf85f7 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width