You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use node-tap with esbuild-runner, it fails to parse source code and show proper line numbers. When I replace esbuild-runner with @swc-node/register, everything works fine.
I am not exactly sure it's esbuild-runner's problem, but I suspect so. I don't think node-tap has some inner hacks specifically tailored to @swc-node/register, it's more probable that esbuild-runner fails to emit the source map in the generally assumable way.
Example
Example source code:
importtapfrom"tap"tap.same("a","b")
Test with @swc-node/register
Everything works as expected, it shows source code fully:
yarn tap --node-arg '-r' --node-arg '@swc-node/register' test.ts
emits:
FAIL test.ts
✖ should be equivalent
test.ts
1 | import tap from "tap"
2 |
> 3 | tap.same("a", "b")
| ----^
--- expected
+++ actual
@@ -1,1 +1,1 @@
-"b"
+"a"
Test with esbuild-register
It fails to parse sourcemap and show source code with proper line numbers:
yarn tap --node-arg '-r' --node-arg 'esbuild-register' test.ts
Problem
When I use
node-tap
withesbuild-runner
, it fails to parse source code and show proper line numbers. When I replaceesbuild-runner
with@swc-node/register
, everything works fine.I am not exactly sure it's
esbuild-runner
's problem, but I suspect so. I don't thinknode-tap
has some inner hacks specifically tailored to@swc-node/register
, it's more probable thatesbuild-runner
fails to emit the source map in the generally assumable way.Example
Example source code:
Test with
@swc-node/register
Everything works as expected, it shows source code fully:
emits:
Test with
esbuild-register
It fails to parse sourcemap and show source code with proper line numbers:
emits:
Reproduction repository
See https://github.com/IlyaSemenov/esbuild-runner-node-tap-repro for the complete repro.
The text was updated successfully, but these errors were encountered: