firefox-devtools / firefox-devtools/vscode-firefox-debug

Bug: breakpoints are not hit after rebuilding the project [vite]

Offen
#383 2 Kommentare 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
TypeScript
Sterne
447
Forks
76
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Related #362

After enabling `sourcemap` for `vite` (see below), I can consistently hit breakpoints, and their locations will be resolved correctly.

```ts
export default defineConfig({
plugins: [sveltekit()], // svelte specific stuff, your config might be different
build: {
sourcemap: true
}
});
```

However, once I rebuild the project (via `vite dev`), breakpoints are no longer hit. No wrong locations, no phantom breakpoints, just not hit at all.

I do wanna stress that rebuilding is something that happens constantly during development, so it should be supported (if possible).

After some investigation, I found out that `vite` appends a timestamp to the sources (and it also keeps old copies), which can be seen in FF's debugger (screenshot below):

![Image](https://github.com/user-attachments/assets/5341fca2-d730-4347-b36d-319ba287aef3)

I wonder if it's related?

## More info

Launch config:

```jsonc
{
"name": "Launch Firefox",
"type": "firefox",
"suggestPathMappingWizard": true,
"reAttach": true,
"request": "launch",
"url": "http://localhost:5173/",
"webRoot": "${workspaceFolder}"
}
```

The same issue happens on neovim and vscode, so it's not client-side related.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Reproduzieren Sie das Problem mit der bereitgestellten Vite-sourcemap-Konfiguration und den Firefox-Startoptionen, indem Sie über `vite dev` neu bauen und dabei das Breakpoint-Verhalten beobachten. Untersuchen Sie, wie zeitgestempelte und beibehaltene Vite-Quellen behandelt werden, und betrachten Sie das Problem als erledigt, wenn Breakpoints nach dem Neubau in Firefox, VS Code und Neovim weiterhin getroffen und korrekt aufgelöst werden.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
typescript, vite
Bereich
devtools
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
42/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.