ts-patch
ts-patch copied to clipboard
ESM broken on Node 21+
Command failed: node run-transform.js mts
TypeError: Function.prototype.apply was called on undefined, which is a undefined and not a function
at Module.wrappedRequire (evalmachine.<anonymous>:132:63)
at require (node:internal/modules/helpers:179:18)
at loadEntryFile (evalmachine.<anonymous>:398:31)
at TspPlugin.createFactory (evalmachine.<anonymous>:376:44)
at PluginCreator.createSourceTransformers (evalmachine.<anonymous>:267:56)
Nasty one. Does not make sense. Potentially an issue with Node. It says originalRequire
is undefined, but it isn't. If we swap this
out of the call, it does not have the error, but it breaks require.