Skip to content
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

New breakpoints are mapped to incorrect lines / sourcemap after webpack HMR in existing attached debugger. #155331

Closed
shahmirn opened this issue Jul 15, 2022 · 6 comments · Fixed by microsoft/vscode-js-debug#1357
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@shahmirn
Copy link
Contributor

shahmirn commented Jul 15, 2022

I have an express server written in Typescript, using Webpack with hot module replacement, and sourcemaps in order to debug.

When I first attach the debugger to the running server, the breakpoints are mapped to the correct lines. However, after a few changes and HMR updating the files, any new breakpoints are mapped to the wrong line, until I disconnect the debugger, and then re-attach it to the process, at which point, new breakpoints are mapped to the correct line again.

Untitled.mp4

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.69.1
  • OS Version: OSX 12 and 13

Steps to Reproduce:

See video above, which shows the issue

@shahmirn shahmirn changed the title New breakpoints are mapped to incorrect lines after webpack HMR in existing attached debugger. New breakpoints are mapped to incorrect lines / sourcemap after webpack HMR in existing attached debugger. Jul 15, 2022
@weinand weinand added the debug Debug viewlet, configurations, breakpoints, adapter issues label Jul 15, 2022
@weinand weinand removed their assignment Jul 15, 2022
@connor4312 connor4312 added the bug Issue identified by VS Code Team member as probable bug label Jul 15, 2022
@connor4312 connor4312 added this to the August 2022 milestone Aug 4, 2022
@connor4312 connor4312 added the author-verification-requested Issues potentially verifiable by issue author label Aug 24, 2022
@connor4312
Copy link
Member

Failing that, this can most easily be tested by using create-react-app, adding some extra logic to the root component, and verifying that you can still set breakpoints at sensible places after repeatedly modifying and moving things around in the file.

@rzhao271
Copy link
Contributor

rzhao271 commented Sep 1, 2022

I moved the logs around and saved the file, but I was unable to add a breakpoint to line 8 because it is where the end of a for loop (}) used to be.

The breakpoint on line 8 cannot be active even though it is a console log call

@rzhao271 rzhao271 reopened this Sep 1, 2022
@rzhao271 rzhao271 removed the author-verification-requested Issues potentially verifiable by issue author label Sep 1, 2022
@rzhao271 rzhao271 modified the milestones: August 2022, September 2022 Sep 1, 2022
@lszomoru lszomoru modified the milestones: September 2022, October 2022 Oct 5, 2022
@connor4312 connor4312 modified the milestones: October 2022, On Deck Oct 25, 2022
@JamesEarle

This comment was marked as off-topic.

@connor4312
Copy link
Member

Generally this is an issue with sourcemaps or some other code transformation. It does not sound like you're facing the same issue as this user.

@connor4312
Copy link
Member

I'm not able to repro this issue, seems thing to work quite well from a UX and code perspective.

Note that you need to save the files for HMR to kick in, and there might be a slight delay before it does. If any issues are encountered, please add trace: true to the launch.json and share the log. Closing for re-verification.

@connor4312 connor4312 added the verification-needed Verification of issue is requested label Aug 3, 2023
@connor4312 connor4312 modified the milestones: On Deck, August 2023 Aug 3, 2023
@rzhao271 rzhao271 added verified Verification succeeded and removed verified Verification succeeded labels Aug 29, 2023
@rzhao271
Copy link
Contributor

Didn't get to it. Might try again later

@andreamah andreamah added the feature-request Request for new features or functionality label Aug 30, 2023
@rzhao271 rzhao271 added the verified Verification succeeded label Aug 31, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Sep 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants