You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the behavior in every version I tried (4.7 - 5.0 nightly), and I reviewed the FAQ for entries about ".cts", "module resolution"
⏯ Playground Link
I tried to use the playground and the bug-workbench, but wasn't able to get it to emit type declaration files. This is a minimal reproduction I created to clearly show the issue:
.cts files are using the import condition, and getting esm types instead of the commonjs types from a node_module package defining "exports".
Even stranger, in VSCode, intellisense is showing "cjs" as the type for (await import("exports")).value in both the .cts and the .mts file, which is the opposite behavior from tsc, which treats them both as "esm".
🙂 Expected behavior
I expected .cts files to use the "require" condition by default (unless modified by the new resolution-mode, available only in nightly).
The text was updated successfully, but these errors were encountered:
weswigham
added
External
Relates to another program, environment, or user action which we cannot control.
and removed
Needs Investigation
This issue needs a team member to investigate its status.
labels
Dec 8, 2022
Bug Report
🔎 Search Terms
"Resolving in ESM mode", ".cts", "NodeNext"
🕗 Version & Regression Information
⏯ Playground Link
I tried to use the playground and the bug-workbench, but wasn't able to get it to emit type declaration files. This is a minimal reproduction I created to clearly show the issue:
https://github.com/IanVS/mts-cts-reproduction
💻 Code
Here's my attempt at the bug workshop, but I suggest checking out my repo above instead.
Workbench Repro
🙁 Actual behavior
.cts
files are using theimport
condition, and getting esm types instead of the commonjs types from a node_module package defining"exports"
.Even stranger, in VSCode, intellisense is showing
"cjs"
as the type for(await import("exports")).value
in both the.cts
and the.mts
file, which is the opposite behavior fromtsc
, which treats them both as"esm"
.🙂 Expected behavior
I expected
.cts
files to use the "require" condition by default (unless modified by the new resolution-mode, available only in nightly).The text was updated successfully, but these errors were encountered: