René's URL Explorer Experiment


Title: Duplicate exports.* = assignments in CommonJS output in some cases · Issue #58772 · microsoft/TypeScript · GitHub

Open Graph Title: Duplicate exports.* = assignments in CommonJS output in some cases · Issue #58772 · microsoft/TypeScript

X Title: Duplicate exports.* = assignments in CommonJS output in some cases · Issue #58772 · microsoft/TypeScript

Description: 🔎 Search Terms commonjs, exports, function 🕗 Version & Regression Information This changed in #58489. ⏯ Playground Link Thanks for merging I'm still seeing an odd behavior I think is related: here's the minimal repro I could find - bug w...

Open Graph Description: 🔎 Search Terms commonjs, exports, function 🕗 Version & Regression Information This changed in #58489. ⏯ Playground Link Thanks for merging I'm still seeing an odd behavior I think is related: here'...

X Description: 🔎 Search Terms commonjs, exports, function 🕗 Version & Regression Information This changed in #58489. ⏯ Playground Link Thanks for merging I'm still seeing an odd behavior I think is relate...

Opengraph URL: https://github.com/microsoft/TypeScript/issues/58772

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.112.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Duplicate exports.* = assignments in CommonJS output in some cases","articleBody":"### 🔎 Search Terms\r\n\r\ncommonjs, exports, function\r\n\r\n### 🕗 Version & Regression Information\r\n\r\n- This changed in https://github.com/microsoft/TypeScript/pull/58489.\r\n\r\n\r\n\r\n### ⏯ Playground Link\r\n\r\nThanks for merging   I'm still seeing an odd behavior I think is related: here's the minimal repro I could find - [bug workbench link](https://www.typescriptlang.org/dev/bug-workbench/?target=1&module=1#code/PTAEAEGcAsHsHcCiBbAlgF3QUwCYDFUAbLALlGQENUA7AOnUgCgQJlYcBXYsgY1mTbUAVk2ZhwAMyJZqFZKXJU6DRqmQAHWACd0oAN6g8sWKAC+oCVv6gARLWBTiAWngZoTrAA9NOm4y8+uhIc1DzoqLDUoDxaWBTYRrAAFACUZIn6jKDZoLHoHFpReqYA3Iym-t7aunoxcQnGoBSQ0bHxWIkAagBMpYxiEI4ycgpDLm4eVTr0TAHVoDTYWhIUPFiGjcX9QA)  \r\n\r\n### 💻 Code\r\n\r\n```ts\r\n// @showEmittedFile: main.ts\r\n// @module: commonjs\r\n\r\n// @filename: main.ts\r\nimport { Foo } from \"./file-with-export\"\r\nexport function createFoo(): Foo {\r\n    return {};\r\n}\r\nexport {createFoo as createFooV2};\r\n\r\n// @filename: file-with-export.ts\r\nexport interface Foo {}\r\n```\r\n\r\n\r\n### 🙁 Actual behavior\r\n\r\nmain.js has two exports for `createFoo` and `createFooV2`:\r\n\r\n``` ts\r\n\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.createFoo = createFoo;\r\nexports.createFooV2 = createFoo;\r\nexports.createFoo = createFoo;\r\nexports.createFooV2 = createFoo;\r\nfunction createFoo() {\r\n    return {};\r\n}\r\n```\r\n\r\n### 🙂 Expected behavior\r\n\r\n``` ts\r\n\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.createFoo = createFoo;\r\nexports.createFooV2 = createFoo;\r\nfunction createFoo() {\r\n    return {};\r\n}\r\n```\r\n\r\n### Additional information about the issue\r\n\r\nI believe this is a result of the fix for https://github.com/microsoft/TypeScript/issues/58473. (I still appreciate having these duplicate exports rather than the compiler dropping the exports entirely 😃 )\r\n\r\nIn the debugger, I see that this `exportedFunctions` (https://github.com/microsoft/TypeScript/blob/506f3e26c3c8af7e4de38996656c947050e68567/src/compiler/transformers/utilities.ts#L108) set contains two separate `createFoo` nodes.\r\n\r\nIf I remove the `export {createFoo as createFooV2}` from the repro, or remove the declared return type `: Foo`, I get the expected behavior.\r\n\r\nThis was uncovered by testing the latest TS version in Google (https://github.com/Microsoft/TypeScript/issues/58685)","author":{"url":"https://github.com/lauraharker","@type":"Person","name":"lauraharker"},"datePublished":"2024-06-04T17:46:48Z","url":"https://github.com/microsoft/TypeScript/issues/58772"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:5c865004-8ad0-120b-4979-b097d30830f1
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB198:293016:2453B3A:30386DE:6B0588DF
html-safe-nonce8482151c8a0f25862a2a43cefcf221e4ebb6f35dfd5706538eed35b6288d52d0
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMTk4OjI5MzAxNjoyNDUzQjNBOjMwMzg2REU6NkIwNTg4REYiLCJ2aXNpdG9yX2lkIjoiMjc1NTYwMjY4MzM0NzE3NTY0NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac384eec34bdbc0d4ed711f3bba326cb38b0f7eadd5b281600fd6edf828f4b5a98
hovercard-subject-tagissue:2334063529
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/58772/issue_layout
twitter:imagehttps://opengraph.githubassets.com/2b13d2ecc63014dce9a709ba91c19131cbe08c5bd3188ed2442c89a34dbe7d40/microsoft/TypeScript/issues/58772
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/2b13d2ecc63014dce9a709ba91c19131cbe08c5bd3188ed2442c89a34dbe7d40/microsoft/TypeScript/issues/58772
og:image:alt🔎 Search Terms commonjs, exports, function 🕗 Version & Regression Information This changed in #58489. ⏯ Playground Link Thanks for merging I'm still seeing an odd behavior I think is related: here'...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamelauraharker
hostnamegithub.com
expected-hostnamegithub.com
None9b4256ac5f3e310e7945ef5b71c9cb9e264357b1eb20e91d369ed6502a4c486c
turbo-cache-controlno-preview
go-importgithub.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git
octolytics-dimension-user_id6154722
octolytics-dimension-user_loginmicrosoft
octolytics-dimension-repository_id20929025
octolytics-dimension-repository_nwomicrosoft/TypeScript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id20929025
octolytics-dimension-repository_network_root_nwomicrosoft/TypeScript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasef089e689ad324655ac44bf6cdbc04d976105b374
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/58772#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F58772
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F58772
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=microsoft%2FTypeScript
Reloadhttps://github.com/microsoft/TypeScript/issues/58772
Reloadhttps://github.com/microsoft/TypeScript/issues/58772
Reloadhttps://github.com/microsoft/TypeScript/issues/58772
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests321 (321)https://github.com/microsoft/TypeScript/pulls
Actionshttps://github.com/microsoft/TypeScript/actions
Projectshttps://github.com/microsoft/TypeScript/projects
Wikihttps://github.com/microsoft/TypeScript/wiki
Security and qualityhttps://github.com/microsoft/TypeScript/security
Insightshttps://github.com/microsoft/TypeScript/insights
https://github.com/microsoft/TypeScript
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/58772
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/58772
#59120https://github.com/microsoft/TypeScript/pull/59120
Duplicate exports.* = assignments in CommonJS output in some caseshttps://github.com/microsoft/TypeScript/issues/58772#top
#59120https://github.com/microsoft/TypeScript/pull/59120
https://github.com/rbuckton
Bughttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
Fix Availablehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fix%20Available%22
TypeScript 5.6.0https://github.com/microsoft/TypeScript/milestone/199
https://github.com/lauraharker
Laura Harker (lauraharker)https://github.com/lauraharker
on Jun 4, 2024https://github.com/microsoft/TypeScript/issues/58772#issue-2334063529
Handle exported functions in ExportDeclarations for CJS/AMD/UMD emit #58489https://github.com/microsoft/TypeScript/pull/58489
bug workbench linkhttps://www.typescriptlang.org/dev/bug-workbench/?target=1&module=1#code/PTAEAEGcAsHsHcCiBbAlgF3QUwCYDFUAbLALlGQENUA7AOnUgCgQJlYcBXYsgY1mTbUAVk2ZhwAMyJZqFZKXJU6DRqmQAHWACd0oAN6g8sWKAC+oCVv6gARLWBTiAWngZoTrAA9NOm4y8+uhIc1DzoqLDUoDxaWBTYRrAAFACUZIn6jKDZoLHoHFpReqYA3Iym-t7aunoxcQnGoBSQ0bHxWIkAagBMpYxiEI4ycgpDLm4eVTr0TAHVoDTYWhIUPFiGjcX9QA
#58473https://github.com/microsoft/TypeScript/issues/58473
TypeScript/src/compiler/transformers/utilities.tshttps://github.com/microsoft/TypeScript/blob/506f3e26c3c8af7e4de38996656c947050e68567/src/compiler/transformers/utilities.ts#L108
506f3e2https://github.com/microsoft/TypeScript/commit/506f3e26c3c8af7e4de38996656c947050e68567
#58685https://github.com/microsoft/TypeScript/issues/58685
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Bughttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
on Jun 7, 2024https://github.com/microsoft/TypeScript/issues/58772#event-13082922599
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Ron Buckton (rbuckton)https://github.com/rbuckton
on Jun 7, 2024https://github.com/microsoft/TypeScript/issues/58772#event-13082923149
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
TypeScript 5.6.0https://github.com/microsoft/TypeScript/milestone/199
on Jun 7, 2024https://github.com/microsoft/TypeScript/issues/58772#event-13082923451
TypeScript Bot (typescript-bot)https://github.com/typescript-bot
Fix Availablehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fix%20Available%22
on Jul 2, 2024https://github.com/microsoft/TypeScript/issues/58772#event-13372333757
Jake Bailey (jakebailey)https://github.com/jakebailey
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#59120https://github.com/microsoft/TypeScript/pull/59120
on Jul 22, 2024https://github.com/microsoft/TypeScript/issues/58772#event-13607721942
microsofthttps://github.com/microsoft
on Oct 22, 2025https://github.com/microsoft/TypeScript/issues/58772#event-20419663466
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/58772
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/58772
Ron Buckton (rbuckton)https://github.com/rbuckton
Bughttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
Fix Availablehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fix%20Available%22
TypeScript 5.6.0https://github.com/microsoft/TypeScript/milestone/199
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.