-
-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Breakpoint on initial render not being called on rerender #179
Comments
The issue is that after fast refresh, the file is different from the point of view of the browser because of the querystring. I need to investigate but this might be tricky to fix given how Vite HMR works currently. @bmeurer maybe you have a different view on this? |
Somewhat related vitejs/vite#13503 (comment) |
I suspect that this is a different problem than vitejs/vite#13503. I think what we're seeing here is that the migration of the breakpoint is racing with the execution of the |
Does bumping the timeout here helps? |
I just checked with Firefox 102.11.0esr (64-bit), which also misses the breakpoint. Bumping the timeout will likely make this more likely to work, but it'd still be flakily missing the breakpoint, since it's still racy. |
One workaround that will always work: Put a |
I'm closing this issue to cleanup because there is not a lot that can be done here and a fix will need to come from a better operability between the debuggers and Vite core. @sapphi-red already merged some PR in that direction: vitejs/vite#13514 |
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
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: