Title: stream: `pipeTo` with `preventCancel` can hit `ERR_INTERNAL_ASSERTION` if destination errors before deferred write · Issue #63732 · nodejs/node · GitHub
Open Graph Title: stream: `pipeTo` with `preventCancel` can hit `ERR_INTERNAL_ASSERTION` if destination errors before deferred write · Issue #63732 · nodejs/node
X Title: stream: `pipeTo` with `preventCancel` can hit `ERR_INTERNAL_ASSERTION` if destination errors before deferred write · Issue #63732 · nodejs/node
Description: Version v24.16.0 Platform Linux n37-114-192 5.15.120.bsk.3-amd64 #5.15.120.bsk.3 SMP Debian 5.15.120.bsk.3 Fri Dec 8 12:41:09 UTC x86_64 GNU/Linux Subsystem stream What steps will reproduce the bug? const { ReadableStream, WritableStream...
Open Graph Description: Version v24.16.0 Platform Linux n37-114-192 5.15.120.bsk.3-amd64 #5.15.120.bsk.3 SMP Debian 5.15.120.bsk.3 Fri Dec 8 12:41:09 UTC x86_64 GNU/Linux Subsystem stream What steps will reproduce the bug...
X Description: Version v24.16.0 Platform Linux n37-114-192 5.15.120.bsk.3-amd64 #5.15.120.bsk.3 SMP Debian 5.15.120.bsk.3 Fri Dec 8 12:41:09 UTC x86_64 GNU/Linux Subsystem stream What steps will reproduce the bug...
Opengraph URL: https://github.com/nodejs/node/issues/63732
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"stream: `pipeTo` with `preventCancel` can hit `ERR_INTERNAL_ASSERTION` if destination errors before deferred write","articleBody":"### Version\n\nv24.16.0\n\n### Platform\n\n```text\nLinux n37-114-192 5.15.120.bsk.3-amd64 #5.15.120.bsk.3 SMP Debian 5.15.120.bsk.3 Fri Dec 8 12:41:09 UTC x86_64 GNU/Linux\n```\n\n### Subsystem\n\nstream\n\n### What steps will reproduce the bug?\n\n```js\nconst { ReadableStream, WritableStream } = require(\"node:stream/web\");\n\nlet sourceController;\nlet destController;\n\nconst source = new ReadableStream({\n start(controller) {\n sourceController = controller;\n },\n});\n\nconst dest = new WritableStream({\n start(controller) {\n destController = controller;\n },\n write() {},\n});\n\nsource.pipeTo(dest, { preventCancel: true }).catch((err) =\u003e {\n console.log(\"pipeTo rejected:\", err.name, err.message);\n});\n\nsetImmediate(() =\u003e {\n destController.error(new Error(\"destination errored\"));\n sourceController.enqueue(\"chunk\");\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`pipeTo()` should reject with the destination error, like v24.14.1 does:\n\n```\npipeTo rejected: Error destination errored\n```\n\n### What do you see instead?\n\n```\nnode:internal/assert:11\n throw new ERR_INTERNAL_ASSERTION(message);\n ^\n\nError [ERR_INTERNAL_ASSERTION]: This is caused by either a bug in Node.js or incorrect usage of Node.js internals.\nPlease open an issue with this stack trace at https://github.com/nodejs/node/issues\n\n at assert (node:internal/assert:11:11)\n at writableStreamDefaultWriterWrite (node:internal/webstreams/writablestream:982:3)\n at node:internal/webstreams/readablestream:1677:33\n at process.processTicksAndRejections (node:internal/process/task_queues:104:5) {\n code: 'ERR_INTERNAL_ASSERTION'\n}\n\nNode.js v24.16.0\n```\n\n### Additional information\n\nThe error starts to occur in v24.15.0. This lines up strongly with https://github.com/nodejs/node/pull/61800.","author":{"url":"https://github.com/colinaaa","@type":"Person","name":"colinaaa"},"datePublished":"2026-06-03T11:06:52.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/63732/node/issues/63732"}
| 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:9dc7d086-5675-8b54-7d87-0a33f0d122cc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ABA6:2EE522:12ECE38:193CA4C:6A4C5FE8 |
| html-safe-nonce | 4b2211de4c74e7122114e1a3ab8a0d5d0b36bb7e42e5aaa541d0b2b82f23dcef |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQkE2OjJFRTUyMjoxMkVDRTM4OjE5M0NBNEM6NkE0QzVGRTgiLCJ2aXNpdG9yX2lkIjoiMTQ5NjcxNDExMzUxMzcwOTU0NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8aac473e07b4ef87031790ef514c1991c6ea729f871a738ca5f0ee9cce160563 |
| hovercard-subject-tag | issue:4579253814 |
| 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/63732/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a4a5bcd986b326d9c0a6f51579cc0bdb62f030b8d07fef9e537e161bcbcf3a7d/nodejs/node/issues/63732 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a4a5bcd986b326d9c0a6f51579cc0bdb62f030b8d07fef9e537e161bcbcf3a7d/nodejs/node/issues/63732 |
| og:image:alt | Version v24.16.0 Platform Linux n37-114-192 5.15.120.bsk.3-amd64 #5.15.120.bsk.3 SMP Debian 5.15.120.bsk.3 Fri Dec 8 12:41:09 UTC x86_64 GNU/Linux Subsystem stream What steps will reproduce the bug... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | colinaaa |
| 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 | 14099438da5379150f15a2892474c7c7e6c0e55e |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width