TypeScript ESM Import Fix
TypeScript with ES modules requires explicit .js extensions in relative imports —
even though the source files are .ts.
- Add a
.jsextension to every relative import (./foo→./foo.js). - Keep it
.jseven when the file on disk isfoo.ts. - Run
tsc --noEmitand confirm there are no module-resolution errors.
If you can't touch every import, set "moduleResolution": "bundler" in tsconfig.json.