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

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

Aperta
#383 2 commenti 2 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
TypeScript
Stelle
447
Fork
76
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Riproducete il problema con la configurazione sourcemap di Vite e le impostazioni di avvio di Firefox fornite, ricostruendo tramite `vite dev` mentre osservate il comportamento dei breakpoint. Esaminate come vengono gestite le sorgenti Vite con timestamp e mantenute, e considerate il problema risolto quando i breakpoint continuano a essere raggiunti e risolti correttamente dopo la ricostruzione in Firefox, VS Code e Neovim.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
typescript, vite
Ambito
devtools
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
42/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.