René's URL Explorer Experiment


Title: `"module": "node16"` should support extension rewriting · Issue #49083 · microsoft/TypeScript · GitHub

Open Graph Title: `"module": "node16"` should support extension rewriting · Issue #49083 · microsoft/TypeScript

X Title: `"module": "node16"` should support extension rewriting · Issue #49083 · microsoft/TypeScript

Description: Bug Report TypeScript 4.7 RC introduces the "module": "node16" setting. When used, this requires users to use the .js extension in import paths. I strongly believe this to be a mistake and TypeScript should instead allow users to use the...

Open Graph Description: Bug Report TypeScript 4.7 RC introduces the "module": "node16" setting. When used, this requires users to use the .js extension in import paths. I strongly believe this to be a mistake and TypeScri...

X Description: Bug Report TypeScript 4.7 RC introduces the "module": "node16" setting. When used, this requires users to use the .js extension in import paths. I strongly believe this to be a ...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`\"module\": \"node16\"` should support extension rewriting","articleBody":"# Bug Report\r\n\r\nTypeScript 4.7 RC introduces the `\"module\": \"node16\"` setting. When used, this requires users to use the `.js` extension in import paths. I strongly believe this to be a mistake and TypeScript should instead allow users to use the `.ts`/`.tsx` extension of the *source* file. It would then be the TS compiler’s responsibility to rewrite this to the *output* file as necessary.\r\n\r\nI have several reasons for requesting this change:\r\n\r\n- The file with the `.js` extension most likely does not exist on disk. It *may* exist on disk if a build has been created and the output is placed right alongside the sources (not a common configuration), but otherwise the file is simply not there or in a different place than one might expect. This is confusing to users, because they need to manually consider how output files are created.\r\n- Using the `.js` extension makes the source code less portable for full-stack projects. If a user wants to use the same sources for a frontend project that uses a bundler, they will be out of luck. A bundler would be able to understand a reference to the `.ts` file (because that one actually exists on disk!), but would struggle with references to files that do not exist for its configuration.\r\n- Using the `.js` extension makes the source incompatible with Deno projects, as they use the `.ts`/`.tsx` extensions, because those are the ones that actually exist.\r\n- Using the `.js` extension is inconsistent with type import. Does `import type { MyType } from “./myFile.js”` even work? It would not make sense because the JS file contains no types. But if it doesn’t work, does that mean I still have to use the `.ts` extensions only for the types? That would be highly annoying.\r\n\r\n### 🔎 Search Terms\r\n\r\nextension rewriting esm module\r\n\r\n### 🕗 Version & Regression Information\r\n\r\nTypeScript 4.7. RC1\r\n\r\n- I was unable to test this on prior versions because the feature is new to version 4.7.\r\n\r\n### 🙁 Actual behavior\r\n\r\nI am forced to write `import { myFunction, type MyType } from “./myFile.js”` despite “./myFile.js” not being a valid path in my project.\r\n\r\n### 🙂 Expected behavior\r\n\r\nI should be able to write `import { myFunction, type MyType } from “./myFile.ts”` because “./myFile.ts” is the actual file I am referring to. Upon compilation I would expect TypeScript to rewrite the path so the output works correctly too.","author":{"url":"https://github.com/arendjr","@type":"Person","name":"arendjr"},"datePublished":"2022-05-12T14:34:16Z","url":"https://github.com/microsoft/TypeScript/issues/49083"}

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:a9689f42-4a6f-2ba7-cb40-fab813fb6a74
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id842A:29FFA9:AD8B5C:DD6AF7:6B00F52D
html-safe-noncee7eb7af8459c453e51e9db15e1abfff159369f4c37ae88d94a64b39160238680
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NDJBOjI5RkZBOTpBRDhCNUM6REQ2QUY3OjZCMDBGNTJEIiwidmlzaXRvcl9pZCI6IjU2MDk0MzU4MDI0NDM1MTEwODUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacd7dd6490ef22aab89c31fe21578ae3076a0b006d7489cab22a577856c3976206
hovercard-subject-tagissue:1234080106
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/49083/issue_layout
twitter:imagehttps://opengraph.githubassets.com/d4cc5dc09cb6a5870913296a3bbeef5efd3323f27841588a7468bc944bb0e733/microsoft/TypeScript/issues/49083
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/d4cc5dc09cb6a5870913296a3bbeef5efd3323f27841588a7468bc944bb0e733/microsoft/TypeScript/issues/49083
og:image:altBug Report TypeScript 4.7 RC introduces the "module": "node16" setting. When used, this requires users to use the .js extension in import paths. I strongly believe this to be a mistake and TypeScri...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamearendjr
hostnamegithub.com
expected-hostnamegithub.com
None4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc
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
release9983dd5da06943f833c971dd5b6bc988e2858be5
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/49083#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F49083
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%2F49083
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/49083
Reloadhttps://github.com/microsoft/TypeScript/issues/49083
Reloadhttps://github.com/microsoft/TypeScript/issues/49083
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests308 (308)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/49083
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/49083
"module": "node16" should support extension rewritinghttps://github.com/microsoft/TypeScript/issues/49083#top
DuplicateAn existing issue was already createdhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Duplicate%22
Out of ScopeThis idea sits outside of the TypeScript language design constraintshttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Out%20of%20Scope%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
https://github.com/arendjr
Arend van Beelen jr. (arendjr)https://github.com/arendjr
on May 12, 2022https://github.com/microsoft/TypeScript/issues/49083#issue-1234080106
Nexthttps://github.com/microsoft/TypeScript/issues/49083?timeline_page=1
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
Out of ScopeThis idea sits outside of the TypeScript language design constraintshttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Out%20of%20Scope%22
on May 12, 2022https://github.com/microsoft/TypeScript/issues/49083#event-6600265194
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on May 12, 2022https://github.com/microsoft/TypeScript/issues/49083#issuecomment-1125258055
#16577 (comment)https://github.com/microsoft/TypeScript/issues/16577#issuecomment-754941937
https://github.com/arendjr
Arend van Beelen jr. (arendjr)https://github.com/arendjr
on May 12, 2022https://github.com/microsoft/TypeScript/issues/49083#issuecomment-1125373790
#16577 (comment)https://github.com/microsoft/TypeScript/issues/16577#issuecomment-703190339
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on May 12, 2022https://github.com/microsoft/TypeScript/issues/49083#issuecomment-1125503248
design goal number 7https://github.com/microsoft/TypeScript/wiki/TypeScript-Design-Goals
https://github.com/arendjr
Arend van Beelen jr. (arendjr)https://github.com/arendjr
on May 13, 2022https://github.com/microsoft/TypeScript/issues/49083#issuecomment-1125662016
https://github.com/arendjr
Arend van Beelen jr. (arendjr)https://github.com/arendjr
on May 21, 2022https://github.com/microsoft/TypeScript/issues/49083#issuecomment-1133588598
https://github.com/mlandalv
Martin Landälv (mlandalv)https://github.com/mlandalv
on May 22, 2022https://github.com/microsoft/TypeScript/issues/49083#issuecomment-1133841016
https://github.com/s123121
knlam (s123121)https://github.com/s123121
on May 25, 2022https://github.com/microsoft/TypeScript/issues/49083#issuecomment-1136688998
https://github.com/neil-morrison44
Neil Morrison (neil-morrison44)https://github.com/neil-morrison44
on May 25, 2022https://github.com/microsoft/TypeScript/issues/49083#issuecomment-1136977809
https://github.com/calebpitan
Caleb Adepitan (calebpitan)https://github.com/calebpitan
on May 25, 2022https://github.com/microsoft/TypeScript/issues/49083#issuecomment-1137062972
Ryan Cavanaugh (@RyanCavanaugh)https://github.com/RyanCavanaugh
Arend van Beelen jr. (@arendjr)https://github.com/arendjr
Arend van Beelen jr. (@arendjr)https://github.com/arendjr
https://github.com/fabis94
Kristaps Fabians Geikins (fabis94)https://github.com/fabis94
on May 25, 2022https://github.com/microsoft/TypeScript/issues/49083#issuecomment-1137069718
https://github.com/jakubmazanec
Jakub Mazanec (jakubmazanec)https://github.com/jakubmazanec
on May 29, 2022https://github.com/microsoft/TypeScript/issues/49083#issuecomment-1140426127
knlam (@s123121)https://github.com/s123121
https://github.com/unional
Homa Wong (unional)https://github.com/unional
on Jun 2, 2022https://github.com/microsoft/TypeScript/issues/49083#issuecomment-1144664340
Wesley Wigham (weswigham)https://github.com/weswigham
DuplicateAn existing issue was already createdhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Duplicate%22
on Jun 2, 2022https://github.com/microsoft/TypeScript/issues/49083#event-6731745517
https://github.com/davidmyersdev
David Myers (davidmyersdev)https://github.com/davidmyersdev
on Aug 29, 2022https://github.com/microsoft/TypeScript/issues/49083#issuecomment-1230950965
pathshttps://www.typescriptlang.org/tsconfig#paths
https://github.com/andrewbranch
Andrew Branch (andrewbranch)https://github.com/andrewbranch
on Aug 29, 2022https://github.com/microsoft/TypeScript/issues/49083#issuecomment-1230969624
voracioushttps://github.com/voracious
#50152https://github.com/microsoft/TypeScript/issues/50152
https://github.com/davidmyersdev
David Myers (davidmyersdev)https://github.com/davidmyersdev
on Sep 3, 2022https://github.com/microsoft/TypeScript/issues/49083#issuecomment-1236211700
Andrew Branch (@andrewbranch)https://github.com/andrewbranch
ink-mdehttps://github.com/voracious/ink-mde
https://github.com/alexandebryakin
Alexander (alexandebryakin)https://github.com/alexandebryakin
on Sep 12, 2022https://github.com/microsoft/TypeScript/issues/49083#issuecomment-1243584024
https://github.com/saurabhsri108
Saurabh Srivastava (saurabhsri108)https://github.com/saurabhsri108
on Jan 10, 2023https://github.com/microsoft/TypeScript/issues/49083#issuecomment-1377410754
https://github.com/GabenGar
GabenGarhttps://github.com/GabenGar
on Feb 17, 2023https://github.com/microsoft/TypeScript/issues/49083#issuecomment-1434587770
https://github.com/t-fritsch
t-fritschhttps://github.com/t-fritsch
on Feb 17, 2023https://github.com/microsoft/TypeScript/issues/49083#issuecomment-1435242019
https://user-images.githubusercontent.com/10920280/219785334-5ce49bda-6d61-4d7b-a220-daf1af95c6b4.png
https://github.com/andrewbranch
Andrew Branch (andrewbranch)https://github.com/andrewbranch
on Feb 17, 2023https://github.com/microsoft/TypeScript/issues/49083#issuecomment-1435314095
https://user-images.githubusercontent.com/3277153/219800118-f718cd5e-85b1-4fec-982a-6e37a86bb2d0.png
https://github.com/t-fritsch
t-fritschhttps://github.com/t-fritsch
on Feb 17, 2023https://github.com/microsoft/TypeScript/issues/49083#issuecomment-1435381031
Andrew Branch (@andrewbranch)https://github.com/andrewbranch
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Feb 17, 2023https://github.com/microsoft/TypeScript/issues/49083#issuecomment-1435383351
https://github.com/t-fritsch
t-fritschhttps://github.com/t-fritsch
on Feb 17, 2023https://github.com/microsoft/TypeScript/issues/49083#issuecomment-1435392764
Ryan Cavanaugh (@RyanCavanaugh)https://github.com/RyanCavanaugh
https://github.com/bakkot
Kevin Gibbons (bakkot)https://github.com/bakkot
on Feb 17, 2023https://github.com/microsoft/TypeScript/issues/49083#issuecomment-1435396964
Ryan Cavanaugh (@RyanCavanaugh)https://github.com/RyanCavanaugh
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Feb 17, 2023https://github.com/microsoft/TypeScript/issues/49083#issuecomment-1435399267
For many years, we've said that adding any "features" that break SFT is one of our biggest regretshttps://youtu.be/MxB0ldQfvT4?t=958
package export mapshttps://nodejs.org/api/packages.html#subpath-exports
this npm package named soundcloud.tshttps://www.npmjs.com/package/soundcloud.ts
microsofthttps://github.com/microsoft
on Feb 17, 2023https://github.com/microsoft/TypeScript/issues/49083#event-8551807621
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Sep 30, 2024https://github.com/microsoft/TypeScript/issues/49083#issuecomment-2383717618
#59767https://github.com/microsoft/TypeScript/pull/59767
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/49083
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/49083
DuplicateAn existing issue was already createdhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Duplicate%22
Out of ScopeThis idea sits outside of the TypeScript language design constraintshttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Out%20of%20Scope%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
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.