-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Breakpoints lost in JS files with HRM #13503
Comments
Start a new pull request in StackBlitz Codeflow. |
If we use TS for the counter module, then dev tools will place the breakpoint following source maps and even when the page is reloaded, it is properly maintained. Working reproduction: https://stackblitz.com/edit/vitejs-vite-z3ykwv The original reproduction doesn't work because it is a |
Thanks for looping me in here. I've created a minimal repro here. From the DevTools perspective there's not a lot we can do: Prior to HMR, the breakpoint is set in I think the suggestion from @patak-dev to force sourcemaps even if no transpilation is necessary would be the ideal fix here. In that case the breakpoint is set on the source-mapped cc @jaro-sevcik |
Closing as #13514 is merged. |
Describe the bug
Hi!
Trying vite with HRM I found that by adding a breakpoint (in the browser inspector) on a js file and then changing something in that file, the breakpoint is lost. This doesn't happen with JSX files. To try this I added a stackblitz where there is a counter.js file. Add a breakpoint on the js file and then modify something on it, the breakpoint will vanish.
Thanks.
Reproduction
https://stackblitz.com/edit/vitejs-vite-b4gczg
Steps to reproduce
Add a breakpoint to the counter.js file and then modify it.
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: vite: ^4.3.9 => 4.3.9
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: