Title: stream/iter: from() accepts async-only nested values from sync iterables · Issue #64351 · nodejs/node · GitHub
Open Graph Title: stream/iter: from() accepts async-only nested values from sync iterables · Issue #64351 · nodejs/node
X Title: stream/iter: from() accepts async-only nested values from sync iterables · Issue #64351 · nodejs/node
Description: Version main Platform macOS 26.5.2 Subsystem stream What steps will reproduce the bug? import { from, text } from 'node:stream/iter'; async function* asyncGenerator() { yield 'data'; } try { console.log(await text(from([asyncGenerator()]...
Open Graph Description: Version main Platform macOS 26.5.2 Subsystem stream What steps will reproduce the bug? import { from, text } from 'node:stream/iter'; async function* asyncGenerator() { yield 'data'; } try { consol...
X Description: Version main Platform macOS 26.5.2 Subsystem stream What steps will reproduce the bug? import { from, text } from 'node:stream/iter'; async function* asyncGenerator() { yield 'data'...
Opengraph URL: https://github.com/nodejs/node/issues/64351
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"stream/iter: from() accepts async-only nested values from sync iterables","articleBody":"### Version\n\nmain\n\n### Platform\n\n```text\nmacOS 26.5.2\n```\n\n### Subsystem\n\nstream\n\n### What steps will reproduce the bug?\n\n```js\nimport { from, text } from 'node:stream/iter';\n\nasync function* asyncGenerator() {\n yield 'data';\n}\n\ntry {\n console.log(await text(from([asyncGenerator()])));\n} catch (error) {\n console.log(`${error.name}: ${error.code ?? error.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`from([asyncGenerator()])` should throw, because the outer source is a sync iterable and the nested value is async-only.\n\nSpec [§8.1](https://stream-iter.jasnell.me/#from-method) says that when `from()` treats a sync iterator as an async source, nested async iterables and `toAsyncStreamable` are unsupported. The sync-iterator fallback currently routes nested values through `normalizeAsyncValue()`, which accepts async iterables and `toAsyncStreamable`, so the nested async generator is consumed instead of rejected.\n\n\n### What do you see instead?\n\n```console\ndata\n```\n\n### Additional information\n\n_No response_","author":{"url":"https://github.com/trivikr","@type":"Person","name":"trivikr"},"datePublished":"2026-07-08T06:22:45.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/64351/node/issues/64351"}
| 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:d9da481b-cb3a-ef9b-9369-81c20130d35f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EB2C:15675C:D06EA2:12A2F82:6A632CBE |
| html-safe-nonce | 677039420871af178628d724ee8fdf212c5fb2ddc7d93debd2c0aa672fe729ba |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQjJDOjE1Njc1QzpEMDZFQTI6MTJBMkY4Mjo2QTYzMkNCRSIsInZpc2l0b3JfaWQiOiI2OTE5NjU0NTgyOTcwOTUyODk0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 705119ccdd31df87610332c1b9f8312413a755d0c49537cdd6593c99d541a2da |
| hovercard-subject-tag | issue:4834916266 |
| 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/64351/issue_layout |
| twitter:image | https://opengraph.githubassets.com/665cebf17d6d752c9ae132e6a563fb2ee6fa9b8f8d3ebe25c4066d21c6624b8e/nodejs/node/issues/64351 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/665cebf17d6d752c9ae132e6a563fb2ee6fa9b8f8d3ebe25c4066d21c6624b8e/nodejs/node/issues/64351 |
| og:image:alt | Version main Platform macOS 26.5.2 Subsystem stream What steps will reproduce the bug? import { from, text } from 'node:stream/iter'; async function* asyncGenerator() { yield 'data'; } try { consol... |
| 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 | 30c644d502bce6cd2e59f9000b4744f2b64819abea8e8f959b18e3ad793125aa |
| 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 | 331492a48ebd91d66ef2de38e1901bb911c9fe9b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width