Comment Comment by uup ts-node isn't an official part of the TypeScript project. It has notoriously bad module support.Try this: // tsconfig.json { "compilerOptions": { "outDir": "dist", "module": "es2020", "allowJs": true }, "files": ["index.ts"] } // index.ts import('./test.mjs').then(console.log) > npx tsc && node ./dist/index.js [Module: null prototype] { Foo: [Function: Foo] } parent uup 4 years ago
Try this: