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
Node will throw an error if you try to require() an ESM file.
To preserve backwards-compatibility, this error-throwing was enabled conditionally in ts-node's require hook. It would only throw if you had opted-in to the ESM loader.
…empting to execute ESM as CJS, even when ESM loader is not loaded (#1232)
* always throw ERR_REQUIRE_ESM when attempting to execute ESM as CJS, even when ESM loader is not loaded
* cleanup
* Fix#1235
* fix bug
Follow-up to #1031
Node will throw an error if you try to require() an ESM file.
To preserve backwards-compatibility, this error-throwing was enabled conditionally in ts-node's require hook. It would only throw if you had opted-in to the ESM loader.
https://github.com/TypeStrong/ts-node/pull/1031/files#diff-a2a171449d862fe29692ce031981047d7ab755ae7f84c707aef80701b3ea0c80R880
However, node behavior for .js files is to always throw, and we need to match that. So as a breaking change, we should do the same.
The text was updated successfully, but these errors were encountered: