Title: Duplex.fromWeb leads to rare internal unhandled rejection · Issue #62199 · nodejs/node · GitHub
Open Graph Title: Duplex.fromWeb leads to rare internal unhandled rejection · Issue #62199 · nodejs/node
X Title: Duplex.fromWeb leads to rare internal unhandled rejection · Issue #62199 · nodejs/node
Description: Version v22.22.0 Platform ubuntu-24.04 (GitHub Actions runner) 20260302.42.1 Subsystem webstreams What steps will reproduce the bug? I encountered this as an occasional flake during CI runs, and haven't been able to narrow down the preci...
Open Graph Description: Version v22.22.0 Platform ubuntu-24.04 (GitHub Actions runner) 20260302.42.1 Subsystem webstreams What steps will reproduce the bug? I encountered this as an occasional flake during CI runs, and ha...
X Description: Version v22.22.0 Platform ubuntu-24.04 (GitHub Actions runner) 20260302.42.1 Subsystem webstreams What steps will reproduce the bug? I encountered this as an occasional flake during CI runs, and ha...
Opengraph URL: https://github.com/nodejs/node/issues/62199
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Duplex.fromWeb leads to rare internal unhandled rejection","articleBody":"### Version\n\nv22.22.0\n\n### Platform\n\n```text\nubuntu-24.04 (GitHub Actions runner) 20260302.42.1\n```\n\n### Subsystem\n\nwebstreams\n\n### What steps will reproduce the bug?\n\nI encountered this as an occasional flake during CI runs, and haven't been able to narrow down the precise sequence of events which cause it, but the root cause in the Node.js code is clear, and suggests an approximate sequence of events (but with some unknown timing requirements):\n\n```js\nimport { TransformStream } from 'node:stream/web';\nimport { Duplex } from 'node:stream';\n\nconst output = Duplex.fromWeb(new TransformStream());\noutput.destroy();\noutput.write('test');\n```\n\nSpecifically, it requires the outer error path in this block (line 729) to be invoked: https://github.com/nodejs/node/blob/bb73c10b3261d699ca6910e5a82d7509020e3a3f/lib/internal/webstreams/adapters.js#L719-L730\n\nThough this was observed in Node.js 22.22.0 (and 20.20.0), the same code still exists in the latest version: https://github.com/nodejs/node/blob/9ff27fdb014c21e869966ffcd053c8e2d872d8c3/lib/internal/webstreams/adapters.js#L791-L802\n\n### How often does it reproduce? Is there a required condition?\n\nIntermittently reproduces. Presumably a small race window which causes this specific error path.\n\n### What is the expected behavior? Why is that the expected behavior?\n\nThe error handler expects to receive an array (which it will, if the error comes from `SafePromiseAll`), which it can filter. It then uses `process.nextTick` explicitly to prevent unhandled rejections. This suggests that the code is intended to never result in an unhandled rejection which would kill the process.\n\n### What do you see instead?\n\nProcess terminates due to an unhandled rejection:\n\n```\nnode:internal/webstreams/adapters:706\n error = error.filter((e) =\u003e e);\n ^\n\nTypeError: Cannot read properties of null (reading 'filter')\n at done (node:internal/webstreams/adapters:706:23)\n```\n\n### Additional information\n\nThe same pattern (and presumably the same bug) also exists in `newStreamWritableFromWritableStream`.","author":{"url":"https://github.com/davidje13","@type":"Person","name":"davidje13"},"datePublished":"2026-03-11T03:13:29.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/62199/node/issues/62199"}
| 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:3bd52d83-f166-8716-bf6f-f5f5f9706f4b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A8A4:E0281:4A5388:65E155:6A4C2FF6 |
| html-safe-nonce | 76c35d9574d417f4f3e59c15da21c53e097ca989a0508e77b10c18c7e2ed73d8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOEE0OkUwMjgxOjRBNTM4ODo2NUUxNTU6NkE0QzJGRjYiLCJ2aXNpdG9yX2lkIjoiMTE0Njk1NzIzOTkyNTA5MjM0MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a9ddfffd40e59188218bcc58e4c23918e25825b131b02b5b2920e4c8190561ee |
| hovercard-subject-tag | issue:4055438097 |
| 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/62199/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8b6c42e6c12692c3f163003b99eb6d1e767096c6e8f0c81294e8bc7e599d572d/nodejs/node/issues/62199 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8b6c42e6c12692c3f163003b99eb6d1e767096c6e8f0c81294e8bc7e599d572d/nodejs/node/issues/62199 |
| og:image:alt | Version v22.22.0 Platform ubuntu-24.04 (GitHub Actions runner) 20260302.42.1 Subsystem webstreams What steps will reproduce the bug? I encountered this as an occasional flake during CI runs, and ha... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | davidje13 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 1b6b16d04026f131a36d57e3b01d0f4d26a51800edf48bf5ed0256e0ac905511 |
| 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 | 9ee13484b32cf23e15fde191da4c9aa47d41201c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width