tsx
tsx copied to clipboard
Better debug output when tsx fails to find a module (especially for tsconfig paths)
Feature request
If tsx fails to find a module to import, list where it looked. Either as a debug option, or better yet just include it as part of the "Cannot find module" error message.
Why?
When tsx doesn't find something it just says Cannot find module '~/foo'. But there do not appear to be any debug options to show why it did not find the module - where did it look (and why would also be useful, e.g. which config option).
This is especially important when tsconfig.paths works fine in vscode but tsx doesn't find it for some reason, we need to be able to trace how tsx tried to resolve the file.
Alternatives
None known.
Additional context
Original discussion: https://github.com/esbuild-kit/tsx/discussions/188
PR welcome!