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
So it seems that before this PR it would ignore the fact that your files are authored using .mts and it would allow you to compile that to a commonjs module. With the new version the extension is always taken into consideration, even with "moduleResolution": "node10".
We can trace back this work to #57896 and #58825 . They mention that from now on extensions should be considered in more module modes but they are not as explicit when it comes to what does it mean for moduleResolution modes.
This is a one-line change to fix your issue but the changed code is also almost explicit when it comes to applying the new logic for extensions regardless of moduleResolution... so I think it's best to ping @andrewbranch and defer to his opinion about this.
Yes, this is working as intended. Compiling .mts files to CommonJS-containing .mjs files was not something we ever intended to support—the fact that it ever worked was a bug / unintentional side effect of other work.
🔎 Search Terms
5.6 commonjs cjs node10 moduleResolution modules regression
🕗 Version & Regression Information
inquirer
Chore(deps-dev): Bump typescript from 5.5.4 to 5.6.2 SBoudrias/Inquirer.js#1554⏯ Playground Link
SBoudrias/Inquirer.js#1554
💻 Code
My tsconfig.cjs.json
🙁 Actual behavior
The files outputted in
dist/cjs
are now using esm module syntax instead fo cjs (import ... from
).🙂 Expected behavior
As of version 5.5.4, the files outputted in
dist/cjs
were cjs (require(...)
).Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: