René's URL Explorer Experiment


Title: TypeScript 7.0.2: Incorrect namespace qualification in import aliases (import =) · Issue #65581 · microsoft/TypeScript · GitHub

Open Graph Title: TypeScript 7.0.2: Incorrect namespace qualification in import aliases (import =) · Issue #65581 · microsoft/TypeScript

X Title: TypeScript 7.0.2: Incorrect namespace qualification in import aliases (import =) · Issue #65581 · microsoft/TypeScript

Description: 🔎 Search Terms Bug Report TypeScript Version: 7.0.2 Description TypeScript 7.0.2 incorrectly emits an unqualified namespace reference when using an import = alias inside a nested namespace. The compiler resolves the symbol correctly but ...

Open Graph Description: 🔎 Search Terms Bug Report TypeScript Version: 7.0.2 Description TypeScript 7.0.2 incorrectly emits an unqualified namespace reference when using an import = alias inside a nested namespace. The com...

X Description: 🔎 Search Terms Bug Report TypeScript Version: 7.0.2 Description TypeScript 7.0.2 incorrectly emits an unqualified namespace reference when using an import = alias inside a nested namespace. The com...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"TypeScript 7.0.2: Incorrect namespace qualification in import aliases (import =)","articleBody":"### 🔎 Search Terms\n\n## Bug Report\n\n**TypeScript Version:** 7.0.2\n\n### Description\n\nTypeScript 7.0.2 incorrectly emits an unqualified namespace reference when using an `import =` alias inside a nested namespace.\n\nThe compiler resolves the symbol correctly but produces JavaScript that throws a `ReferenceError` at runtime.\n\nThis works correctly in TypeScript 6 and also works in TypeScript 7 when using an explicitly qualified namespace or replacing the alias with a `const` declaration.\n\n### Minimal Reproduction\n\n```typescript\nnamespace DX.SCPModule.VendorNavigator {\n    export class Result {\n        value = 42;\n    }\n}\n\nnamespace DX.Mvc.OrganizationSearch {\n    import Result = SCPModule.VendorNavigator.Result;\n\n    export const result = new Result();\n}\n```\n\nCompile with TypeScript 7.0.2 using:\n\n```bash\ntsc --ignoreConfig repro.ts --target es2020 --module es2020\n```\n\n### Actual Behavior\n\nTypeScript 7 emits:\n\n```javascript\nvar Result = SCPModule.VendorNavigator.Result;\n```\n\nThis produces:\n\n```text\nReferenceError: SCPModule is not defined\n```\n\nThe `SCPModule` variable is scoped to a different namespace IIFE and is not accessible at this location.\n\n### Expected Behavior\n\nThe compiler should emit the fully qualified reference:\n\n```javascript\nvar Result = DX.SCPModule.VendorNavigator.Result;\n```\n\nThis is the behavior observed with TypeScript 6.\n\n### Workarounds\n\nBoth of the following work correctly in TypeScript 7.0.2:\n\n**Explicit qualification:**\n\n```typescript\nimport Result = DX.SCPModule.VendorNavigator.Result;\n```\n\n**Using a const instead of an import alias:**\n\n```typescript\nconst Result = SCPModule.VendorNavigator.Result;\n```\n\nThe second workaround correctly emits:\n\n```javascript\nconst Result = DX.SCPModule.VendorNavigator.Result;\n```\n\nThis suggests the issue is specific to `import =` alias emission rather than general namespace reference resolution.\n\n### Related Issues\n\n- microsoft/typescript-go#961\n- microsoft/typescript-go#2846\n\nPR #2846 fixed related namespace qualification issues, but this particular `import =` alias scenario appears to remain broken in TypeScript 7.0.2.\n\n### 🕗 Version & Regression Information\n\n- This changed between versions ______ and _______\n- This changed in commit or PR _______\n- This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________\n- I was unable to test this on prior versions because _______\n\n\n### ⏯ Playground Link\n\n_No response_\n\n### 💻 Code\n\n```ts\n// Your code here\n```\n\n\n### 🙁 Actual behavior\n\nTypeScript 7.0.2 incorrectly emits an unqualified namespace reference when using an `import =` alias inside a nested namespace.\n\nGiven:\n\n```typescript\nnamespace DX.Mvc.OrganizationSearch {\n    import Result = SCPModule.VendorNavigator.Result;\n}\n```\n\nThe compiler generates:\n\n```javascript\nvar Result = SCPModule.VendorNavigator.Result;\n```\n\nThis causes a runtime `ReferenceError: SCPModule is not defined`, because `SCPModule` is not accessible in the current JavaScript scope.\n\nThe issue does not occur when replacing `import =` with `const` or explicitly qualifying the namespace with `DX`.\n\n### 🙂 Expected behavior\n\nTypeScript 7 should correctly resolve and emit the fully qualified namespace reference, as TypeScript 6 does.\n\nExpected JavaScript output:\n\n```javascript\nvar Result = DX.SCPModule.VendorNavigator.Result;\n```\n\nThe generated JavaScript should execute without a `ReferenceError`, without requiring explicit namespace qualification in the TypeScript source.\n\n### Additional information about the issue\n\n_No response_","author":{"url":"https://github.com/pirobox","@type":"Person","name":"pirobox"},"datePublished":"2026-11-19T15:11:32Z","url":"https://github.com/microsoft/TypeScript/issues/65581"}

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:96c38e78-a756-ab6b-e01d-d4ceee35cc19
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC18E:31B4CC:959C5D:C6E49E:6B00E1C8
html-safe-noncef78d8bb13005ce2506e2cc3b40eea368b5376b3a3972c0ca695996a0f782e210
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMThFOjMxQjRDQzo5NTlDNUQ6QzZFNDlFOjZCMDBFMUM4IiwidmlzaXRvcl9pZCI6IjkyMTA5NzUzMTU2Mjk3NjA5NjgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac2be81e78233a9493e2ad16f184c768c9e3799c812346719c5554ecdd960a1598
hovercard-subject-tagissue:6492672740
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/65581/issue_layout
twitter:imagehttps://opengraph.githubassets.com/c4fd09fcf75256931b4cb641af5f963a8eb9fb723fa9acb223ab7e2e6d3322dc/microsoft/TypeScript/issues/65581
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/c4fd09fcf75256931b4cb641af5f963a8eb9fb723fa9acb223ab7e2e6d3322dc/microsoft/TypeScript/issues/65581
og:image:alt🔎 Search Terms Bug Report TypeScript Version: 7.0.2 Description TypeScript 7.0.2 incorrectly emits an unqualified namespace reference when using an import = alias inside a nested namespace. The com...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamepirobox
hostnamegithub.com
expected-hostnamegithub.com
None043c3f30fbcbe2c6c8e729e10cbbbc90c406546f9fbbb67c648d38f6b7d16daf
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
release5425dc24e8bd8d6fca9641a12afc984825a43875
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/65581#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F65581
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%2F65581
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/65581
Reloadhttps://github.com/microsoft/TypeScript/issues/65581
Reloadhttps://github.com/microsoft/TypeScript/issues/65581
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests309 (309)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/65581
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/65581
TypeScript 7.0.2: Incorrect namespace qualification in import aliases (import =)https://github.com/microsoft/TypeScript/issues/65581#top
https://github.com/pirobox
piroboxhttps://github.com/pirobox
on Nov 19, 2026https://github.com/microsoft/TypeScript/issues/65581#issue-6492672740
tsgo fails to resolve namespace symbols in non-extends contexts across files typescript-go#961https://github.com/microsoft/typescript-go/issues/961
Fix emit for non-local/merged enum/namespace references typescript-go#2846https://github.com/microsoft/typescript-go/pull/2846
#2846https://github.com/microsoft/TypeScript/issues/2846
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/65581
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/65581
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

Viewport: width=device-width


URLs of crawlers that visited me.