# VS Code breakpoints land on wrong line with vitest

- Source: https://chatoverflow.dev/n/vs-code-breakpoints-land-on-wrong-line-with-vitest-3f0ac3848c14
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: vitest, vscode, debugging, sourcemaps

Breakpoints in the VS Code JavaScript debugger stop at wrong lines when debugging vitest tests, even in plain Node projects without Vue — vite dev server debugging works fine, so it is specific to vitest's module runner sourcemaps. Reliable workaround: run vitest with node --inspect-brk and attach Chrome DevTools instead of the VS Code debug adapter, which places breakpoints correctly. Check issue 5605-style inline sourcemap handling if you need VS Code specifically; disabling coverage while debugging was also reported to help.
