Title: stream/iter: share() does not serialize overlapping next() calls on a consumer · Issue #63477 · nodejs/node · GitHub
Open Graph Title: stream/iter: share() does not serialize overlapping next() calls on a consumer · Issue #63477 · nodejs/node
X Title: stream/iter: share() does not serialize overlapping next() calls on a consumer · Issue #63477 · nodejs/node
Description: Version 26.2.0 Platform macOS 26.5.0 Subsystem stream What steps will reproduce the bug? import { share } from 'node:stream/iter'; async function* source() { yield [new TextEncoder().encode('first')]; yield [new TextEncoder().encode('sec...
Open Graph Description: Version 26.2.0 Platform macOS 26.5.0 Subsystem stream What steps will reproduce the bug? import { share } from 'node:stream/iter'; async function* source() { yield [new TextEncoder().encode('first'...
X Description: Version 26.2.0 Platform macOS 26.5.0 Subsystem stream What steps will reproduce the bug? import { share } from 'node:stream/iter'; async function* source() { yield [new TextEncoder().encode...
Opengraph URL: https://github.com/nodejs/node/issues/63477
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"stream/iter: share() does not serialize overlapping next() calls on a consumer","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 { share } from 'node:stream/iter';\n\nasync function* source() {\n yield [new TextEncoder().encode('first')];\n yield [new TextEncoder().encode('second')];\n}\n\nconst decoder = new TextDecoder();\nconst it = share(source()).pull()[Symbol.asyncIterator]();\n\nconst p1 = it.next();\nconst p2 = it.next();\n\nconst [r1, r2] = await Promise.all([p1, p2]);\n\nconsole.log('p1:', decoder.decode(r1.value[0]));\nconsole.log('p2:', decoder.decode(r2.value[0]));\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\np1: first\np2: second\n```\n\n`p1` is the earlier `next()` call on the same async iterator, so it should resolve with the earlier chunk.\n\n### What do you see instead?\n\n```console\np1: second\np2: first\n```\n\n### Additional information\n\n_No response_","author":{"url":"https://github.com/trivikr","@type":"Person","name":"trivikr"},"datePublished":"2026-05-21T15:12:49.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/63477/node/issues/63477"}
| 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:e1311d24-6aa3-3689-b623-feb626ce2515 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CDFC:3FCB4A:B9ADAF:10AA7B1:6A4CC1C5 |
| html-safe-nonce | 9fdc22a49cfb1d5a2017c8ccdc127d1c763ae9666e6188db0fc3ab79afb68ad1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDREZDOjNGQ0I0QTpCOUFEQUY6MTBBQTdCMTo2QTRDQzFDNSIsInZpc2l0b3JfaWQiOiIzNjA0NTc1NzE3NTQ1NTI1NzAxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 9cee51777b6080336744d84382516797ae065d2f60ca2152a96b49b339f84702 |
| hovercard-subject-tag | issue:4495697625 |
| 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/63477/issue_layout |
| twitter:image | https://opengraph.githubassets.com/34ff82fcac3c89bfa620f3b57b08c8346c210667622de4f7a6d4816be3a25fce/nodejs/node/issues/63477 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/34ff82fcac3c89bfa620f3b57b08c8346c210667622de4f7a6d4816be3a25fce/nodejs/node/issues/63477 |
| og:image:alt | Version 26.2.0 Platform macOS 26.5.0 Subsystem stream What steps will reproduce the bug? import { share } from 'node:stream/iter'; async function* source() { yield [new TextEncoder().encode('first'... |
| 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 | 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 | c03e7e569190bc89b638cdd4acb4b6c6b38a170a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width