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

Debugging react app with hot-reloading does not work

Abierto
#215 5 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
TypeScript
Estrellas
447
Forks
76
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Steps to reproduce:

1. create new react app: `npx create-react-app my-app`
1. start react app: `export BROWSER=none && yarn start`
1. start debugging in vscode - see `launch.json` below
1. set a breakpoint in App.js file
1. change some code in App.js file, e.g. add a `console.log('foo')`

Result:
After changing anything in App.js file, and the changed code gets hot-reloaded in the dev server, no breakpoint is hit anymore.
Sometimes breakpoints are still hit and code execution stops but at the wrong line in the vscode editor. This usually happens if you remove or add lines of code in a file, where you previously set a breakpoint. It seems as if the debugger still stops at the line where the breakpoint was before adding / removing lines of code.

Expected Result:
all breakpoints should still be working after changing and hot-reloading code

Note:
Debugging works as expected as long as I restart the dev server (`yarn start`) after every code change. But I think that is not the way it was intended to be done?

launch.json:
```
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch localhost",
"type": "firefox",
"request": "launch",
"reAttach": true,
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}/src"
}
]
}
```

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Reproduce el problema con los pasos indicados de create-react-app, `yarn start`, `App.js` y el `launch.json` proporcionado; empieza comprobando cómo el Firefox VS Code debugger gestiona los cambios en el código fuente recargado en caliente. Se considera completado cuando los puntos de interrupción permanecen activos y la ejecución se detiene en las líneas correctas después de añadir o eliminar código sin reiniciar el servidor de desarrollo.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
javascript, react, typescript, vscode
Área
developer-experience, devtools, frontend
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.