Closed IlyaSemenov closed 1 year ago
As the issue template says, for reproductions that have dependencies or more than a code-snippet, you'll have to provide a link to a reproduction repository.
Since this issue is currently unverifiable, I'm going to close it. Please understand, there are many issues with inadequate reproductions that end up being an unrelated issue or expected behavior. I cannot afford to spend time re-recreating and debugging a reproduction that may potentially not be an issue.
Happy to re-open once a repro is provided so the issue is easily verifiable and debuggable.
Reproduction repo https://github.com/IlyaSemenov/esbuild-kit-repro-170
Looked into this and there's no tsx bug.
With the version you had in your reproduction
tap --no-coverage --node-arg '--require=@esbuild-kit/cjs-loader' test.ts
With the latest tsx:
tap --no-coverage --node-arg '--require=tsx/cjs' test.ts
Bug description
I run
node-tap
tests withtsx
as the loader.I expect the stack trace reports to properly show the failing lines.
Instead, it always shows line 2 as the source of the error, regardless of how large the test file is.
When I replace tsx loader with
@swc-node/register
, everything works fine. I don't thinknode-tap
has some inner hacks specifically tailored to@swc-node/register
, it's more probable thattsx
doesn't communicate with the tooling in some generally assumable way (whatever it be).Reproduction
In an empty folder:
Create
test.ts
:Run
pnpm tap --no-coverage --node-arg '--loader' --node-arg 'tsx' test.ts
, you will get:Run
pnpm tap --no-coverage --node-arg '-r' --node-arg '@swc-node/register' test.ts
, you will get:Environment
Can you contribute a fix?