Skip to content

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

@SystemParadox

Description

@SystemParadox

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions