Describe the bug
Hi!
While trying Vite on a React Project and debugging it I found that if you add a breakpoint (on the browser inspector) on a useEffect with an empty array of dependencies it won't be triggered when you force a Hot Reload, but the code is being executed. For example, if you add a console log in the useEffect you will see the Log in the console when you trigger a reload but the breakpoint is not called.
I leave an example on stackblitz.
Thanks!
Reproduction
https://stackblitz.com/edit/vitejs-vite-mlud4j
Steps to reproduce
Just put a breakpoint on the console log inside the useEffect and modify the content of the string to force a hot reload.
System Info
System:
OS: Linux 5.0 undefined
CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 0 Bytes / 0 Bytes
Shell: 1.0 - /bin/jsh
Binaries:
Node: 16.14.2 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 9.4.2 - /usr/local/bin/npm
npmPackages:
@vitejs/plugin-react: ^4.0.0 => 4.0.0
vite: ^4.3.9 => 4.3.9
Used Package Manager
npm
Logs
No response
Validations
Describe the bug
Hi!
While trying Vite on a React Project and debugging it I found that if you add a breakpoint (on the browser inspector) on a useEffect with an empty array of dependencies it won't be triggered when you force a Hot Reload, but the code is being executed. For example, if you add a console log in the useEffect you will see the Log in the console when you trigger a reload but the breakpoint is not called.
I leave an example on stackblitz.
Thanks!
Reproduction
https://stackblitz.com/edit/vitejs-vite-mlud4j
Steps to reproduce
Just put a breakpoint on the console log inside the useEffect and modify the content of the string to force a hot reload.
System Info
System: OS: Linux 5.0 undefined CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz Memory: 0 Bytes / 0 Bytes Shell: 1.0 - /bin/jsh Binaries: Node: 16.14.2 - /usr/local/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 9.4.2 - /usr/local/bin/npm npmPackages: @vitejs/plugin-react: ^4.0.0 => 4.0.0 vite: ^4.3.9 => 4.3.9Used Package Manager
npm
Logs
No response
Validations