Source map accuracy issue specific to TypeScript in Svelte 5.
The issue involves inaccurate source maps when using TypeScript in Svelte 5, particularly affecting terminal output and error pages. The problem appears related to preprocessing configurations, possibly involving Vite. While the reproduction is clear, the fix may require understanding both Svelte's and Vite's source map handling.
Source maps are seemingly inaccurate when lang="ts" is enabled on the <script> tag. This only occurs when using TS in Svelte 5. Removing lang="ts" fixes the issue.
When presented with the following Svelte code:

Errors locations are accurate in the IDE (as shown above), but are off in both the terminal output, and the error page.

https://github.com/AdrianGonz97/svelte-5-ts-source-maps-reproduction
No response
System:
OS: Linux 5.15 Ubuntu 20.04.5 LTS (Focal Fossa)
CPU: (24) x64 AMD Ryzen 9 5900X 12-Core Processor
Memory: 7.95 GB / 31.30 GB
Container: Yes
Shell: 5.8 - /usr/bin/zsh
Binaries:
Node: 20.10.0 - ~/.volta/tools/image/node/20.10.0/bin/node
Yarn: 1.22.21 - ~/.volta/tools/image/yarn/1.22.21/bin/yarn
npm: 10.2.3 - ~/.volta/tools/image/node/20.10.0/bin/npm
pnpm: 8.10.5 - ~/.volta/bin/pnpm
bun: 1.0.2 - ~/.bun/bin/bun
npmPackages:
svelte: ^5.0.0-next.26 => 5.0.0-next.26
annoyance
Claim this issue to let others know you're working on it. You'll earn 10 points when you complete it!