ts-node-esm is broken in node v20+ (tested on v20.4), we should move to node --no-warnings=ExperimentalWarning --loader ts-node/esm src/main.tsbefore it's fixed.
> ts-node-esm -T src/main.ts
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /Users/adamek/htdocs/apify/test-ts-actor/src/main.ts
at new NodeError (node:internal/errors:405:5)
at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:99:9)
at defaultGetFormat (node:internal/modules/esm/get_format:142:36)
at defaultLoad (node:internal/modules/esm/load:91:20)
at nextLoad (node:internal/modules/esm/hooks:733:28)
at load (/Users/adamek/htdocs/apify/test-ts-actor/node_modules/ts-node/dist/child/child-loader.js:19:122)
at nextLoad (node:internal/modules/esm/hooks:733:28)
at Hooks.load (node:internal/modules/esm/hooks:377:26)
at MessagePort.handleMessage (node:internal/modules/esm/worker:168:24)
at [nodejs.internal.kHybridDispatch] (node:internal/event_target:778:20) {
code: 'ERR_UNKNOWN_FILE_EXTENSION'
}
ts-node-esm
is broken in node v20+ (tested on v20.4), we should move tonode --no-warnings=ExperimentalWarning --loader ts-node/esm src/main.ts
before it's fixed.Related: https://github.com/apify/crawlee/issues/1966