ts-node icon indicating copy to clipboard operation
ts-node copied to clipboard

ESM + path mapping

Open damianobarbati opened this issue 1 year ago • 3 comments

Is https://typestrong.org/ts-node/docs/paths/ supposed to be working with ESM?

Adding the following to tsconfig.json:

  "ts-node": {
    "esm": true,
    "experimentalSpecifierResolution": "node",
    "require": ["tsconfig-paths/register"]
  }

Results in this error:

Error: Cannot find package '@controller/Lesson' imported from /Users/damians/Desktop/box696/packages/api/src/jobs.ts

When trying to load any mapped import:

import LessonController from '@controller/Lesson';

damianobarbati avatar Sep 21 '23 13:09 damianobarbati

same as

soom-lupulus avatar Sep 24 '23 09:09 soom-lupulus

Here's my workaround for the issue and the thread has other suggestions too

Naddiseo avatar Oct 03 '23 20:10 Naddiseo

Check this response.

sleep-written avatar Nov 05 '23 04:11 sleep-written