import.meta.resolve(pathToDirectory)
returns a different result when running with tsx
compared to node
#480
Labels
Acknowledgements
Minimal reproduction URL
https://github.com/haines/tsx-import-meta-resolve
Version
v4.7.1
Node.js version
v20.11.1
Package manager
npm
Operating system
macOS
Problem & Expected behavior
I want to resolve the path to a directory within one of my dependencies. I'm using ESM so I call
import.meta.resolve
.For example,
Doing this in
node
returns a file URL with the path to the directory:However, when I run the script via
tsx
, I unexpectedly get a file URL with the path toindex.js
within the directory (which is a non-existent file):Contributions
The text was updated successfully, but these errors were encountered: