privatenumber / tsx

⚡️ TypeScript Execute | The easiest way to run TypeScript in Node.js
https://tsx.is
MIT License
8.61k stars 132 forks source link

Cannot resolve `.` path #599

Closed sxzz closed 4 days ago

sxzz commented 6 days ago

Acknowledgements

Minimal reproduction URL

https://github.com/sxzz/tsx-issue

Problem & expected behavior (under 200 words)

import test from '.' // ❌ not working
// import test from './index' // ✅ working

Bugs are expected to be fixed by those affected by it

Compensating engineering work will speed up resolution and support the project

privatenumber commented 4 days ago

Your reproduction doesn't reproduce the bug for me:

$ pnpm tsx index.js
{}
works
privatenumber commented 4 days ago

I've added a test case to confirm this is working: https://github.com/privatenumber/tsx/commit/c67e3baefdb4b38d44779a44e21f2a989482911c

sxzz commented 4 days ago

Using CLI works, but using Node API does not. Run node index.js instead.

(Sorry for forgetting to mention how to run it)

privatenumber commented 4 days ago

Gotcha, no worries.

This was fixed inadvertently via https://github.com/privatenumber/tsx/releases/tag/v4.15.8