Source map line numbers wrong
- 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):


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):


the tsup sourcemap points to this line
https://github.com/Floffah/crossant/blob/tsup-problems/packages/bot/src/sharding/AppManager.ts#L188
Contributor guide
Assessment
This issue has not been assessed yet.