Closed TheDogHusky closed 2 months ago
Can you make your reproduction minimal? Happy to reopen once ready
As I have no ideas where the error comes from, I cannot tell which part of the whole repository causes the issue.
So making a minimal reproduction is pretty hard while including the cause of the error.
Hey @TheDogHusky,
This is a bug tracker, meant for reporting bugs with clear, reproducible steps and proof that the issue is with tsx. Without a minimal reproduction that isolates the problem, it's difficult to determine if the issue lies with tsx or with your specific setup.
If I debug without proof, the issue could end up being in your environment, and I'd essentially be offering free debugging support—which I don't have time for. However, if you can provide a minimal reproduction that clearly shows the issue is with tsx, I'd be happy to reopen the issue and investigate further.
Thanks for understanding!
I don't know if this will be of any help but I found the cause of this error with me was dead imports. This was happening in an import of an import of an import...
import { blah } from "@myAlias/thisDoesntActuallyExist"
Would it be possible for TSX to identify missing imports rather than give a slightly confusing error message?
Please don't comment on closed issues unless it's to re-open it (e.g. minimal repro provided).
You can file feature requests in the sponsor repo: https://github.com/pvtnbr/tsx
Acknowledgements
Minimal reproduction URL
https://github.com/NekoNyaDevs/bot
Problem & expected behavior (under 200 words)
So I'm updating a bot, and wanted to use tsx watch on development. I installed the package
npm i tsx
, made a script in package.json withcross-env NODE_ENV=development tsx watch src/index
as content, on node 20.12.0. I ran the script, and got greeted by a painful error:I also tried on node 22.8.0, got the same issue. When I run
tsc && node lib/index
it works fine. So it must be a TSX issue (a guess, I could be wrong in my tsconfig too). I tried without the watch mode and still got an error.Thank you in advance if you can help me out. I found that here had open a similar issue, that was outdated. And the solutions inside it didn't work. I don't use ESM, I'm on commonjs.
Bugs are expected to be fixed by those affected by it
Compensating engineering work will speed up resolution and support the project