Title: TypeError: Could not convert argument of type symbol to string when setting headers with Headers object in Node.js v22.2.0 · Issue #53069 · nodejs/node · GitHub
Open Graph Title: TypeError: Could not convert argument of type symbol to string when setting headers with Headers object in Node.js v22.2.0 · Issue #53069 · nodejs/node
X Title: TypeError: Could not convert argument of type symbol to string when setting headers with Headers object in Node.js v22.2.0 · Issue #53069 · nodejs/node
Description: Version v22.2.0 Platform Microsoft Windows NT 10.0.22631.0 x64 Subsystem idk :undici package (dependency used by Next.js) What steps will reproduce the bug? Create a new Next.js project using the latest version (as of writing, it's Next....
Open Graph Description: Version v22.2.0 Platform Microsoft Windows NT 10.0.22631.0 x64 Subsystem idk :undici package (dependency used by Next.js) What steps will reproduce the bug? Create a new Next.js project using the l...
X Description: Version v22.2.0 Platform Microsoft Windows NT 10.0.22631.0 x64 Subsystem idk :undici package (dependency used by Next.js) What steps will reproduce the bug? Create a new Next.js project using the l...
Opengraph URL: https://github.com/nodejs/node/issues/53069
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"TypeError: Could not convert argument of type symbol to string when setting headers with Headers object in Node.js v22.2.0","articleBody":"### Version\n\nv22.2.0\n\n### Platform\n\nMicrosoft Windows NT 10.0.22631.0 x64\n\n### Subsystem\n\nidk :undici package (dependency used by Next.js)\n\n### What steps will reproduce the bug?\n\nCreate a new Next.js project using the latest version (as of writing, it's Next.js 13.2.4).\r\nIn one of the pages , import the Headers object from undici and try to set headers,\r\nlet headers = new Headers();\r\nheaders.set('Access-Control-Allow-Credentials', true);\r\nheaders.set('Access-Control-Allow-Origin', '*');\r\nheaders.set('x-auth-token',' process.env.EXAMPLE.TOKEN');\r\n\n\n### How often does it reproduce? Is there a required condition?\n\nThe issue reproduces consistently when running the above steps with Node.js version 22.2.0.\n\n### What is the expected behavior? Why is that the expected behavior?\n\nThe expected behavior is for the Headers object to correctly accept and set the provided header key-value pairs without throwing any errors. This is the expected behavior because the Headers object should handle string values for both header keys and values according to the documentation and specifications.\n\n### What do you see instead?\n\nTypeError: Could not convert argument of type symbol to string.\r\n at webidl.converters.DOMString (node:internal/deps/undici/undici:1977:15)\r\n at webidl.converters.ByteString (node:internal/deps/undici/undici:1982:35)\r\n at Object.record\u003cByteString, ByteString> (node:internal/deps/undici/undici:1894:30)\r\n at webidl.converters.HeadersInit (node:internal/deps/undici/undici:3424:67)\r\n at new Headers (node:internal/deps/undici/undici:3278:36)\r\n \n\n### Additional information\n\n\"undici\": \"5.23.0\",","author":{"url":"https://github.com/elhaddajiOtmane","@type":"Person","name":"elhaddajiOtmane"},"datePublished":"2024-05-20T10:32:56Z","url":"https://github.com/nodejs/node/issues/53069"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:4f5d3ba1-d7e4-c92a-c9aa-d092890c9bd8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C79A:3684D6:3AAD52:4AE230:6B03584C |
| html-safe-nonce | 056a867ef32938f05a96703c05b5d2406ce49525e909ee5a37ad500dd00767e7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNzlBOjM2ODRENjozQUFENTI6NEFFMjMwOjZCMDM1ODRDIiwidmlzaXRvcl9pZCI6Ijg4MjUxNjkxNjIzMjMzMTg4NjAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 08f35cbfffc42e9110fe4d32b8752bf3389f5204927e6fc135049aa55f1f1858 |
| hovercard-subject-tag | issue:2305672535 |
| 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/53069/issue_layout |
| twitter:image | https://opengraph.githubassets.com/dcefaf761fd61e281b7eb3d03fc298d9168d21062081400de69e9c16cc51a2a2/nodejs/node/issues/53069 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/dcefaf761fd61e281b7eb3d03fc298d9168d21062081400de69e9c16cc51a2a2/nodejs/node/issues/53069 |
| og:image:alt | Version v22.2.0 Platform Microsoft Windows NT 10.0.22631.0 x64 Subsystem idk :undici package (dependency used by Next.js) What steps will reproduce the bug? Create a new Next.js project using the l... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | elhaddajiOtmane |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| 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 | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width