Title: Buffer.concat documentation is wrong · Issue #60400 · nodejs/node · GitHub
Open Graph Title: Buffer.concat documentation is wrong · Issue #60400 · nodejs/node
X Title: Buffer.concat documentation is wrong · Issue #60400 · nodejs/node
Description: node/doc/api/buffer.md Line 1042 in 2bda7cb If `totalLength` is provided, it is coerced to an unsigned integer. If the This is not what happens. Instead, non-integers throw: > Buffer.concat([Buffer.of()],2.6) Uncaught: RangeError [ERR_OU...
Open Graph Description: node/doc/api/buffer.md Line 1042 in 2bda7cb If `totalLength` is provided, it is coerced to an unsigned integer. If the This is not what happens. Instead, non-integers throw: > Buffer.concat([Buffer...
X Description: node/doc/api/buffer.md Line 1042 in 2bda7cb If `totalLength` is provided, it is coerced to an unsigned integer. If the This is not what happens. Instead, non-integers throw: > Buffer.concat([Buf...
Opengraph URL: https://github.com/nodejs/node/issues/60400
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Buffer.concat documentation is wrong","articleBody":"https://github.com/nodejs/node/blob/2bda7cbfb62778bd793fbceaa9a5a907c3d344be/doc/api/buffer.md?plain=1#L1042\n\nThis is not what happens. Instead, non-integers throw:\n```\n\u003e Buffer.concat([Buffer.of()],2.6)\nUncaught:\nRangeError [ERR_OUT_OF_RANGE]: The value of \"length\" is out of range. It must be an integer. Received 2.6\n at validateOffset (node:buffer:123:3)\n at Buffer.concat (node:buffer:590:5) {\n code: 'ERR_OUT_OF_RANGE'\n}\n\u003e Buffer.concat([Buffer.of()],'10')\nUncaught:\nTypeError [ERR_INVALID_ARG_TYPE]: The \"length\" argument must be of type number. Received type string ('10')\n at validateOffset (node:buffer:123:3)\n at Buffer.concat (node:buffer:590:5) {\n code: 'ERR_INVALID_ARG_TYPE'\n}\n```\n\n---\n\nLess significant, but also confusing (ref: https://github.com/nodejs/node/pull/55562)\n\nhttps://github.com/nodejs/node/blob/2bda7cbfb62778bd793fbceaa9a5a907c3d344be/doc/api/buffer.md?plain=1#L1044-L1045\n\nThis is not always true, as this happens on empty lists:\n\nhttps://github.com/nodejs/node/blob/2bda7cbfb62778bd793fbceaa9a5a907c3d344be/doc/api/buffer.md?plain=1#L1036-L1037\n\n```\n\u003e Buffer.concat([],100)\n\u003cBuffer \u003e\n```","author":{"url":"https://github.com/ChALkeR","@type":"Person","name":"ChALkeR"},"datePublished":"2025-10-25T01:23:35.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/60400/node/issues/60400"}
| 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:f330f212-ad3e-0729-2429-e458d6c1a95a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8498:1E1B0E:4C683D:6CF357:6A4CA370 |
| html-safe-nonce | 6f8db160d5f3fa62ad86cdf265f6fdbc178470491031e153324e43a9ae2d2a67 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NDk4OjFFMUIwRTo0QzY4M0Q6NkNGMzU3OjZBNENBMzcwIiwidmlzaXRvcl9pZCI6IjQ1MzgyMzEwMTEzMTg0NzM1ODQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 82f8d30c50eb9ad0c1dfbcc28fc4e74e5d67122499f1e8abd207988c0fc3c994 |
| hovercard-subject-tag | issue:3551478681 |
| 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/60400/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b1fbe6715093d9ef4f9b279f36aa6949681a8913140baa071caa8e7b815b9fc3/nodejs/node/issues/60400 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b1fbe6715093d9ef4f9b279f36aa6949681a8913140baa071caa8e7b815b9fc3/nodejs/node/issues/60400 |
| og:image:alt | node/doc/api/buffer.md Line 1042 in 2bda7cb If `totalLength` is provided, it is coerced to an unsigned integer. If the This is not what happens. Instead, non-integers throw: > Buffer.concat([Buffer... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ChALkeR |
| 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 | ae90d426644ca15e89bacceb72e51f4e9dbf85f7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width