privatenumber / tsx

⚡️ TypeScript Execute | The easiest way to run TypeScript in Node.js
https://tsx.is
MIT License
9.77k stars 154 forks source link

`ERR_UNSUPPORTED_ESM_URL_SCHEME` when running tsx watch on windows and importing using `await import(path)` #667

Open TheDogHusky opened 1 month ago

TheDogHusky commented 1 month ago

Acknowledgements

Minimal reproduction URL

https://github.com/TheDogHusky/tsx-issue-import

Problem & expected behavior (under 200 words)

The README from the minimal reproduction repo should explain in enough details.

Bugs are expected to be fixed by those affected by it

Compensating engineering work will speed up resolution and support the project

TheDogHusky commented 1 month ago

I precedently made an issue (https://github.com/privatenumber/tsx/issues/650) but couldn't figure out the cause of the error, now I figured it out, and am submitting an issue here.

mvarendorff commented 1 week ago

Probable dupe: https://github.com/privatenumber/tsx/issues/345

mvarendorff commented 1 week ago

If others stumble upon this - since the other issue is now closed and locked, I opened a PR in the repro of this issue with two approaches on how to fix this:

https://github.com/TheDogHusky/tsx-issue-import/pull/1

fwiw, this does not appear to be an issue with tsx but node (the same error shows when doing the same setup with node+js).