I am trying to run node 14 with my package.json set as module:
"type": "module",
If I run this command on a typescript file:
node --loader ts-node/esm.mjs --experimental-top-level-await ./src/scripts/ts-build.ts --trace-warnings --experimental-json-modules
and I have extensionless imports like this in a typescript file
import { logger } from './logger';
I get
ERR_MODULE_NOT_FOUND
But if I change it to
import { logger } from './logger.js';
It works.
Why is this?