Title: stream/iter: pipeTo() crashes when synchronous writev() returns undefined · Issue #63560 · nodejs/node · GitHub
Open Graph Title: stream/iter: pipeTo() crashes when synchronous writev() returns undefined · Issue #63560 · nodejs/node
X Title: stream/iter: pipeTo() crashes when synchronous writev() returns undefined · Issue #63560 · nodejs/node
Description: Version 26.2.0 Platform macOS 26.5.0 Subsystem stream What steps will reproduce the bug? import { pipeTo } from 'node:stream/iter'; async function* source() { yield [new Uint8Array([65]), new Uint8Array([66])]; } const chunks = []; const...
Open Graph Description: Version 26.2.0 Platform macOS 26.5.0 Subsystem stream What steps will reproduce the bug? import { pipeTo } from 'node:stream/iter'; async function* source() { yield [new Uint8Array([65]), new Uint8...
X Description: Version 26.2.0 Platform macOS 26.5.0 Subsystem stream What steps will reproduce the bug? import { pipeTo } from 'node:stream/iter'; async function* source() { yield [new Uint8Array([65]), n...
Opengraph URL: https://github.com/nodejs/node/issues/63560
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"stream/iter: pipeTo() crashes when synchronous writev() returns undefined","articleBody":"### Version\n\n26.2.0\n\n### Platform\n\n```text\nmacOS 26.5.0\n```\n\n### Subsystem\n\nstream\n\n### What steps will reproduce the bug?\n\n```js\nimport { pipeTo } from 'node:stream/iter';\n\nasync function* source() {\n yield [new Uint8Array([65]), new Uint8Array([66])];\n}\n\nconst chunks = [];\nconst writer = {\n write(chunk) {\n chunks.push(chunk);\n },\n writev(batch) {\n chunks.push(...batch);\n // Synchronous success: returns undefined.\n },\n end() {},\n};\n\ntry {\n const bytes = await pipeTo(source(), writer);\n console.log('resolved:', bytes, Buffer.concat(chunks).toString());\n} catch (err) {\n console.log('rejected:', `${err.name}: ${err.message}`);\n}\n```\n\n### How often does it reproduce? Is there a required condition?\n\nAlways\n\n### What is the expected behavior? Why is that the expected behavior?\n\n```console\nresolved: 2 AB\n```\n\n### What do you see instead?\n\n```console\nrejected: TypeError: Method Promise.prototype.then called on incompatible receiver undefined\n```\n\npiping into a custom writer that supports batched writes fails even though the writer successfully accepts the data synchronously. The same kind of synchronous success works for single writes, so batched `writev()` writes should complete normally instead of rejecting with a `TypeError`.\n\n### Additional information\n\n_No response_","author":{"url":"https://github.com/trivikr","@type":"Person","name":"trivikr"},"datePublished":"2026-05-25T16:05:17.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/63560/node/issues/63560"}
| 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:eeb6bd14-b916-404a-d160-61e9e41f8cb4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 98C8:1ED2:18857A1:23BD704:6A4CFEEF |
| html-safe-nonce | 2e9a0ae732c3a79bed0f646279b460a5b28d2eb27dbf21eb04fcf597ac159e1e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OEM4OjFFRDI6MTg4NTdBMToyM0JENzA0OjZBNENGRUVGIiwidmlzaXRvcl9pZCI6IjUxMTQ2MzMwNTU3MTM5NTE0NzIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f4bcb9aae3ceefc21704fcd87f687013507ba5cd3de147539325057b42f23947 |
| hovercard-subject-tag | issue:4518162653 |
| 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/63560/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7510ca502655107e93ec0cbba73a83027eede4d2bd43fd95b4d0a9fd2233ef83/nodejs/node/issues/63560 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7510ca502655107e93ec0cbba73a83027eede4d2bd43fd95b4d0a9fd2233ef83/nodejs/node/issues/63560 |
| og:image:alt | Version 26.2.0 Platform macOS 26.5.0 Subsystem stream What steps will reproduce the bug? import { pipeTo } from 'node:stream/iter'; async function* source() { yield [new Uint8Array([65]), new Uint8... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | trivikr |
| hostname | github.com |
| expected-hostname | github.com |
| None | 31e4db13a9e20081f2fac78f441659a6576e582bbb15e153f9c7fb6473aa29f5 |
| 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 | fb70bd3c4b2bec429781b65419e912c66e2d5581 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width