Skip to content

ERR_UNSUPPORTED_ESM_URL_SCHEME error is thrown if path alias contains a colon #730

@andreww2012

Description

@andreww2012

Acknowledgements

  • I read the documentation and searched existing issues to avoid duplicates
  • I understand this is a bug tracker and anything other than a proven bug will be closed
  • I understand this is a free project and relies on community contributions
  • I read and understood the Contribution guide

Minimal reproduction URL

https://github.com/andreww2012/tsx-doesnt-support-tsconfig-paths-with-colons

Problem & expected behavior (under 200 words)

Hello. It seems like tsx is not able to properly handle TypeScript path aliases containing a colon. My IDE (VSCode) and tsc are able to resolve such paths.

In the reproduction, run npx tsx a-fail.ts to get the error:

Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'a:'

On the contrary, running npx tsx a-ok.ts would execute the code successfully.

Bugs are expected to be fixed by those affected by it

  • I'm interested in working on this issue

Compensating engineering work will speed up resolution and support the project

  • I'm willing to offer $10 for financial support

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions