egoist / egoist/tsup

Source map line numbers wrong

Open
#434 1 comment 5 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
11.3k
Forks
275
PR merge metrics
No merged PRs in 30d

Description

This issue is the same as the one in esbuild [#638](https://github.com/evanw/esbuild/issues/638) and was fixed there. I have tested my codebase using raw esbuild and the issue is not present there.
Basically, the problem is that line numbers are wrong in source maps therefore in stack traces.
You can reproduce using this repo https://github.com/Floffah/crossant/tree/tsup-problems/packages/bot

it seems this only happens when using splitting

Expected (using esbuild):
![image](https://user-images.githubusercontent.com/27270386/136701921-f4ac6d12-ccf1-49fb-a90e-857a766c81fb.png)
![image](https://user-images.githubusercontent.com/27270386/136701930-68171920-3834-4b9f-85fd-4f06ee08a1ba.png)
the error was created on this line
https://github.com/Floffah/crossant/blob/tsup-problems/packages/bot/src/sharding/AppManager.ts#L97
(i know i forgot to minify, however if i minify it the line number is still correct here)

What really happens (with tsup):
![image](https://user-images.githubusercontent.com/27270386/136701982-e267caf6-2449-4eea-b671-be733376ecf8.png)
![image](https://user-images.githubusercontent.com/27270386/136701991-73713731-1b31-46f0-aed8-04e950ac0b1a.png)
the tsup sourcemap points to this line
https://github.com/Floffah/crossant/blob/tsup-problems/packages/bot/src/sharding/AppManager.ts#L188

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.