Skip to main content
GoodFirstPicks
DashboardIssuesReposLeaderboard

GoodFirstPicks by Leaveitblank © 2026

CreatorRequest a RepoPrivacy PolicyTerms of Service
Svelte 5: Inaccurate source maps when `lang="ts"` is enabled | GoodFirstPicks

Svelte 5: Inaccurate source maps when `lang="ts"` is enabled

sveltejs/svelte 7 comments 1mo ago
View on GitHub
mediumopenScope: somewhat clearSkill match: maybeSvelteTypeScript

Why this is a good first issue

Source map accuracy issue specific to TypeScript in Svelte 5.

AI Summary

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.

Issue Description

Describe the bug

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:

img

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

img

Reproduction

https://github.com/AdrianGonz97/svelte-5-ts-source-maps-reproduction

Logs

No response

System Info

  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

Severity

annoyance

GitHub Labels

bug

Want to work on this?

Claim this issue to let others know you're working on it. You'll earn 10 points when you complete it!

Risk Flags

  • potential interaction with Vite preprocessing
  • source map generation complexity
Loading labels...

Details

Points10 pts
Difficultymedium
Scopesomewhat clear
Skill Matchmaybe
Test Focusedno
Assigneedummdidumm