René's URL Explorer Experiment


Title: TS Build api failed when using node ESM module (mjs) · Issue #56366 · microsoft/TypeScript · GitHub

Open Graph Title: TS Build api failed when using node ESM module (mjs) · Issue #56366 · microsoft/TypeScript

X Title: TS Build api failed when using node ESM module (mjs) · Issue #56366 · microsoft/TypeScript

Description: 🔎 Search Terms ESM ts.sys undefined 🕗 Version & Regression Information This is the behavior in every version I tried, and I reviewed the FAQ for entries about modules ⏯ Playground Link https://github.com/stevebeauge/tsc-api-esm 💻 Code im...

Open Graph Description: 🔎 Search Terms ESM ts.sys undefined 🕗 Version & Regression Information This is the behavior in every version I tried, and I reviewed the FAQ for entries about modules ⏯ Playground Link https://gith...

X Description: 🔎 Search Terms ESM ts.sys undefined 🕗 Version & Regression Information This is the behavior in every version I tried, and I reviewed the FAQ for entries about modules ⏯ Playground Link https://...

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

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"TS Build api failed when using node ESM module (mjs)","articleBody":"### 🔎 Search Terms\n\nESM ts.sys undefined \n\n### 🕗 Version & Regression Information\n\n- This is the behavior in every version I tried, and I reviewed the FAQ for entries about modules\r\n\r\n\n\n### ⏯ Playground Link\n\nhttps://github.com/stevebeauge/tsc-api-esm\n\n### 💻 Code\n\n```ts\r\nimport * as tsc from \"typescript\";\r\n\r\nconst tsSystem = tsc.sys;\r\n\r\nconsole.log({ tsSystem });\r\n\r\n```\r\n\n\n### 🙁 Actual behavior\n\nIf I transpile this code into CJS and run `node index.cjs` works as expected (tsc.sys is defined).\r\n\r\nIf I transpile this code into ESM and run `node index.mjs` the code does not works as expected (tsc.sys is undefined).\r\n\r\n\n\n### 🙂 Expected behavior\n\ntsc.sys (`System`) should be available in CLI tools, whether the output is ESM or CJS.\n\n### Additional information about the issue\n\nThe issue occurs when trying to create a CLI tool that require parsing tsconfig files, including potential \"extends\". Typescript provides an API for that.\r\n\r\nHowever, my cli tool requires to be ESM because of some imports not available as CJS.\r\n\r\nRepro steps (using pnpm but it does not matter):\r\n\r\n````\r\ngit clone https://github.com/stevebeauge/tsc-api-esm\r\ncd tsc-api-esm\r\npnpm i \r\nnode index.cjs\r\nnode index.mjs\r\n````\r\n\r\nWhen using cjs : OK\r\nWhen using ESM : KO\r\n\r\nMy investigations leds me to : https://github.com/microsoft/TypeScript/blob/80ab111685e3e0c10d8d13cdd18d8dffa8328895/src/compiler/core.ts#L2748\r\n\r\nIt populates the tsc.sys when the function \"isNodeLikeSystem\" returns true. However, the test expect to have `module` be defined (which is true in CJS, not in ESM).","author":{"url":"https://github.com/stevebeauge","@type":"Person","name":"stevebeauge"},"datePublished":"2023-11-10T20:30:45Z","url":"https://github.com/microsoft/TypeScript/issues/56366"}

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:6531106f-090b-a692-dbf3-0f61b128d55f
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idCD30:9FD79:C5E1E8:105BCF2:6B04FF33
html-safe-noncea016ea0a448e404ef3c8d7f2742769075a0a018b69badbeca16c6ce48ecfa204
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRDMwOjlGRDc5OkM1RTFFODoxMDVCQ0YyOjZCMDRGRjMzIiwidmlzaXRvcl9pZCI6Ijc2MDMwOTczNzg1ODA5MjIxNjMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac9aa1c41efcd7414c8124dabbe72f724fdde7c227bbb9b2467a52ce1a0a790ef0
hovercard-subject-tagissue:1988344869
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/56366/issue_layout
twitter:imagehttps://opengraph.githubassets.com/1319fb58614d2af4f12f058cce488338c6c2eabc0f1c11c1c9b91a6b476d7aac/microsoft/TypeScript/issues/56366
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/1319fb58614d2af4f12f058cce488338c6c2eabc0f1c11c1c9b91a6b476d7aac/microsoft/TypeScript/issues/56366
og:image:alt🔎 Search Terms ESM ts.sys undefined 🕗 Version & Regression Information This is the behavior in every version I tried, and I reviewed the FAQ for entries about modules ⏯ Playground Link https://gith...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamestevebeauge
hostnamegithub.com
expected-hostnamegithub.com
None854d880890b5e847b3fce9d1b31f032107baeddeebad2aa379c48aa4f1451f6b
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
release220e980097d94ce616d5d11fbd5316d208e3fc93
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/56366#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F56366
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%2F56366
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/56366
Reloadhttps://github.com/microsoft/TypeScript/issues/56366
Reloadhttps://github.com/microsoft/TypeScript/issues/56366
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests319 (319)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/56366
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/56366
#57133https://github.com/microsoft/TypeScript/pull/57133
TS Build api failed when using node ESM module (mjs)https://github.com/microsoft/TypeScript/issues/56366#top
#57133https://github.com/microsoft/TypeScript/pull/57133
https://github.com/jakebailey
Fix Availablehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fix%20Available%22
Needs Investigationhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Needs%20Investigation%22
Backloghttps://github.com/microsoft/TypeScript/milestone/29
https://github.com/stevebeauge
Steve Beaugé (stevebeauge)https://github.com/stevebeauge
on Nov 10, 2023https://github.com/microsoft/TypeScript/issues/56366#issue-1988344869
https://github.com/stevebeauge/tsc-api-esmhttps://github.com/stevebeauge/tsc-api-esm
TypeScript/src/compiler/core.tshttps://github.com/microsoft/TypeScript/blob/80ab111685e3e0c10d8d13cdd18d8dffa8328895/src/compiler/core.ts#L2748
80ab111https://github.com/microsoft/TypeScript/commit/80ab111685e3e0c10d8d13cdd18d8dffa8328895
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Needs Investigationhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Needs%20Investigation%22
on Nov 10, 2023https://github.com/microsoft/TypeScript/issues/56366#event-10929563551
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Jake Bailey (jakebailey)https://github.com/jakebailey
on Nov 10, 2023https://github.com/microsoft/TypeScript/issues/56366#event-10929564315
https://github.com/jakebailey
Jake Bailey (jakebailey)https://github.com/jakebailey
on Nov 10, 2023https://github.com/microsoft/TypeScript/issues/56366#issuecomment-1806435815
https://github.com/stevebeauge
Steve Beaugé (stevebeauge)https://github.com/stevebeauge
on Nov 10, 2023https://github.com/microsoft/TypeScript/issues/56366#issuecomment-1806446001
Steve Beaugé (stevebeauge)https://github.com/stevebeauge
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Nov 10, 2023https://github.com/microsoft/TypeScript/issues/56366#event-10929724452
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Jake Bailey (jakebailey)https://github.com/jakebailey
on Nov 10, 2023https://github.com/microsoft/TypeScript/issues/56366#event-10929724686
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Questionhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Question%22
Needs Investigationhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Needs%20Investigation%22
on Nov 10, 2023https://github.com/microsoft/TypeScript/issues/56366#event-10929725247
https://github.com/jakebailey
Jake Bailey (jakebailey)https://github.com/jakebailey
on Nov 10, 2023https://github.com/microsoft/TypeScript/issues/56366#issuecomment-1806446209
https://github.com/jakebailey
Jake Bailey (jakebailey)https://github.com/jakebailey
on Nov 10, 2023https://github.com/microsoft/TypeScript/issues/56366#issuecomment-1806474096
https://nodejs.org/api/esm.html#commonjs-namespaceshttps://nodejs.org/api/esm.html#commonjs-namespaces
https://private-user-images.githubusercontent.com/5341706/282184804-4689a645-3670-4e81-b10e-495ef9f42e0c.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3OTU0ODk4ODgsIm5iZiI6MTc5NTQ4OTU4OCwicGF0aCI6Ii81MzQxNzA2LzI4MjE4NDgwNC00Njg5YTY0NS0zNjcwLTRlODEtYjEwZS00OTVlZjlmNDJlMGMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MTEyNCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjExMjRUMDMwNjI4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MGQ5NGFkMGVjZDZlNWYzZWY0NTA2Yzk3M2JmNDNmNjI0YWZlNTBmMTMzYTNiNTY1NWQwMjIyZTZkNzdjOTUyMyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmcmVzcG9uc2UtY29udGVudC10eXBlPWltYWdlJTJGcG5nIn0.vUkJ0Dh8D0QaXQSpGy4Lh9dYxoX0qDk8oRY7cnDV3tU
https://github.com/jakebailey
Jake Bailey (jakebailey)https://github.com/jakebailey
on Nov 10, 2023https://github.com/microsoft/TypeScript/issues/56366#issuecomment-1806477709
Jake Bailey (jakebailey)https://github.com/jakebailey
on Nov 10, 2023https://github.com/microsoft/TypeScript/issues/56366#event-10929909940
Jake Bailey (jakebailey)https://github.com/jakebailey
Needs Investigationhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Needs%20Investigation%22
Questionhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Question%22
on Nov 10, 2023https://github.com/microsoft/TypeScript/issues/56366#event-10929910718
Jake Bailey (jakebailey)https://github.com/jakebailey
on Nov 10, 2023https://github.com/microsoft/TypeScript/issues/56366#event-10929910796
Jake Bailey (jakebailey)https://github.com/jakebailey
Backloghttps://github.com/microsoft/TypeScript/milestone/29
on Nov 10, 2023https://github.com/microsoft/TypeScript/issues/56366#event-10929915582
https://github.com/stevebeauge
Steve Beaugé (stevebeauge)https://github.com/stevebeauge
on Nov 10, 2023https://github.com/microsoft/TypeScript/issues/56366#issuecomment-1806478939
https://github.com/jakebailey
Jake Bailey (jakebailey)https://github.com/jakebailey
on Nov 10, 2023https://github.com/microsoft/TypeScript/issues/56366#issuecomment-1806479568
https://github.com/stevebeauge
Steve Beaugé (stevebeauge)https://github.com/stevebeauge
on Nov 10, 2023https://github.com/microsoft/TypeScript/issues/56366#issuecomment-1806483928
https://github.com/nodech
Nodar Chkuaselidze (nodech)https://github.com/nodech
on Nov 11, 2023https://github.com/microsoft/TypeScript/issues/56366#issuecomment-1806861678
https://github.com/jakebailey
Jake Bailey (jakebailey)https://github.com/jakebailey
on Nov 11, 2023https://github.com/microsoft/TypeScript/issues/56366#issuecomment-1806866500
https://github.com/jakebailey
Jake Bailey (jakebailey)https://github.com/jakebailey
on Jan 22, 2024https://github.com/microsoft/TypeScript/issues/56366#issuecomment-1904951364
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 Jan 23, 2024https://github.com/microsoft/TypeScript/issues/56366#event-11563381060
https://github.com/jakebailey
Jake Bailey (jakebailey)https://github.com/jakebailey
on Jan 23, 2024https://github.com/microsoft/TypeScript/issues/56366#issuecomment-1905139245
#57133https://github.com/microsoft/TypeScript/pull/57133
Jake Bailey (jakebailey)https://github.com/jakebailey
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#57133https://github.com/microsoft/TypeScript/pull/57133
on Mar 4, 2024https://github.com/microsoft/TypeScript/issues/56366#event-12004774568
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/56366
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/56366
Jake Bailey (jakebailey)https://github.com/jakebailey
Fix Availablehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fix%20Available%22
Needs Investigationhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Needs%20Investigation%22
BacklogNo due datehttps://github.com/microsoft/TypeScript/milestone/29
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.