You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Wrong root(cwd) determination for esm modules #1881
Hi! During debug I have noticed something interesting. To use top-level await I've changed package to module and activated esm for ts-node. However right after this import for json files stopped working.
Here is what I have in IDE
And here is the base path ts-node is trying to resolve workspace.json against to.
I think you should take root path from tsconfig to resolve imports, same as typescript does. Otherwise is different logic
For now I'd prefer not to use ts-node with esm: true.
Activity
ThePlenkov commentedon Sep 11, 2022
it's important - I run the command from the root
npx my-commandwhere my-command is a link to a workspace ts file with ts-node shebangThePlenkov commentedon Sep 11, 2022
So current workaround instead of import to use dynamic import: