tsx icon indicating copy to clipboard operation
tsx copied to clipboard

Better debug output when tsx fails to find a module (especially for tsconfig paths)

Open SystemParadox opened this issue 2 years ago • 1 comments
trafficstars

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

SystemParadox avatar Jul 15 '23 14:07 SystemParadox

PR welcome!

privatenumber avatar Nov 09 '23 11:11 privatenumber