Title: `export { _void as void }` leads to exporting duplicate identifiers · Issue #62081 · microsoft/TypeScript · GitHub
Open Graph Title: `export { _void as void }` leads to exporting duplicate identifiers · Issue #62081 · microsoft/TypeScript
X Title: `export { _void as void }` leads to exporting duplicate identifiers · Issue #62081 · microsoft/TypeScript
Description: 🔎 Search Terms export void export reserved export null 🕗 Version & Regression Information Reproducible since typescript v4. In older releases, it doesn't export anything. I also tried the latest dev release (5.9.0-dev.20250716) This is t...
Open Graph Description: 🔎 Search Terms export void export reserved export null 🕗 Version & Regression Information Reproducible since typescript v4. In older releases, it doesn't export anything. I also tried the latest de...
X Description: 🔎 Search Terms export void export reserved export null 🕗 Version & Regression Information Reproducible since typescript v4. In older releases, it doesn't export anything. I also tried the l...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/62081
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`export { _void as void }` leads to exporting duplicate identifiers","articleBody":"### 🔎 Search Terms\n\n`export void` `export reserved` `export null`\n\n### 🕗 Version & Regression Information\n\n- Reproducible since typescript v4. In older releases, it doesn't export anything. I also tried the latest dev release (5.9.0-dev.20250716)\n- This is the behavior in every version I tried, and I reviewed the FAQ for entries about `exports`\n\n\n### ⏯ Playground Link\n\n[Playground (important: lang:javascript)](https://www.typescriptlang.org/play/?target=99&jsx=0&filetype=js#code/FAUwHgDg9gTgLgAgMZQHYGdEH0BuUCWAJggLwIDeAvsKJLIuQrgcQIboJ5EKUI1A)\n\n### 💻 Code\nUsing the following `tsconfig.json`:\n\n```json\n{\n \"compilerOptions\": {\n \"target\": \"esnext\",\n \"lib\": [\"esnext\"],\n \"module\": \"esnext\",\n \"allowJs\": true,\n \"checkJs\": true,\n \"declaration\": true,\n \"declarationMap\": true,\n \"outDir\": \"./dist\",\n \"emitDeclarationOnly\": true,\n \"strict\": true,\n \"noImplicitAny\": true,\n \"moduleResolution\": \"bundler\"\n }\n}\n```\n\nI compile declaration files for this code `${project}/schema.js` (only happens when compiling javascript):\n\n```ts\nconst _null = {}\nconst $void = {}\n\nexport { _null as null, $void as void }\n```\n\n### 🙁 Actual behavior\n\nThe produced declaration file `schema.d.ts` is erroneous. It has duplicate identifiers:\n\n```ts\ndeclare const _null: {};\ndeclare const $void: {};\nexport { _null as null, _null as null, $void as void, _void as void };\n```\n\n### 🙂 Expected behavior\n\nNo duplicate identifiers:\n\n```ts\ndeclare const _null: {};\ndeclare const $void: {};\nexport { _null as null, $void as void };\n```\n\n### Additional information about the issue\n\nFor any reserved keyword, `tsc` always exports `_{reserved} as {reserved}`, whenever `{reserved}` is exported. Even though the variable `_{reserved}` does not exist.\n\nIt is only reproducible when compiling javascript.","author":{"url":"https://github.com/dmonad","@type":"Person","name":"dmonad"},"datePublished":"2025-07-16T18:36:57Z","url":"https://github.com/microsoft/TypeScript/issues/62081"}
| 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:de9bccea-ee3e-8f8f-cc7d-ad98145ee42a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EBEA:10531B:C8806A:FF94B1:6B013CAC |
| html-safe-nonce | ec6c37b281fef15ad22fb44e1f1b12cee98facc5b6722b86358d222b1d1546a1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQkVBOjEwNTMxQjpDODgwNkE6RkY5NEIxOjZCMDEzQ0FDIiwidmlzaXRvcl9pZCI6IjYzNDI4MDMwNDAxOTM1NTk3MjQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 27a301bd62afb128b06f2b067b15680c33726b6c6709d7ad6a2b94c9fb27d43e |
| hovercard-subject-tag | issue:3236971369 |
| 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/microsoft/TypeScript/62081/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4fe76497d97364ec53f3409871cbbfc17fe9dabe2e0b0e44f912a5993384d517/microsoft/TypeScript/issues/62081 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4fe76497d97364ec53f3409871cbbfc17fe9dabe2e0b0e44f912a5993384d517/microsoft/TypeScript/issues/62081 |
| og:image:alt | 🔎 Search Terms export void export reserved export null 🕗 Version & Regression Information Reproducible since typescript v4. In older releases, it doesn't export anything. I also tried the latest de... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dmonad |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width