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

Debug: cannot break in main.js or app.ts on startup #159684

Closed
bpasero opened this issue Aug 31, 2022 · 5 comments · Fixed by #159695 or #168921
Closed

Debug: cannot break in main.js or app.ts on startup #159684

bpasero opened this issue Aug 31, 2022 · 5 comments · Fixed by #159695 or #168921
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug debt Code quality issues debug Debug viewlet, configurations, breakpoints, adapter issues insiders-released Patch has been released in VS Code Insiders papercut 🩸 A particularly annoying issue impacting someone on the team verified Verification succeeded
Milestone

Comments

@bpasero
Copy link
Member

bpasero commented Aug 31, 2022

I am using the VSCode launch config and cannot stop in a breakpoint at either of these 2 locations:

I am on macOS SI.

@bpasero bpasero added debug Debug viewlet, configurations, breakpoints, adapter issues papercut 🩸 A particularly annoying issue impacting someone on the team labels Aug 31, 2022
@connor4312 connor4312 added this to the September 2022 milestone Aug 31, 2022
connor4312 added a commit that referenced this issue Aug 31, 2022
Debugging the main process is fairly lightweight, so let's just always do it. Also, have more appropriate launch config names

 Fixes #159684
connor4312 added a commit that referenced this issue Aug 31, 2022
Debugging the main process is fairly lightweight, so let's just always do it. Also, have more appropriate launch config names

 Fixes #159684
@vscodenpa vscodenpa added the unreleased Patch has not yet been released in VS Code Insiders label Aug 31, 2022
@bpasero
Copy link
Member Author

bpasero commented Sep 1, 2022

I think main.js still does not work, but app.ts does.

@vscodenpa vscodenpa added insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Sep 2, 2022
@connor4312 connor4312 reopened this Sep 2, 2022
@vscodenpa vscodenpa removed the insiders-released Patch has been released in VS Code Insiders label Sep 2, 2022
@connor4312
Copy link
Member

connor4312 commented Oct 6, 2022

This is because it's a JS file, so it gets moved into out without a sourcemap. We don't support pathMappings in Node.js, but if we did they could be used to fix this (mapping out to src). This is an old PR that I might just try to 'rebuild' manually at some point: microsoft/vscode-js-debug#1015

An interim workaround is setting breakpoints in out/main.js. Or we could make main.js a TypeScript file instead. Just renaming it to .ts doesn't seem to cause issues (aside from TypeScript errors 😛 ) and makes debugging work. What do you think?

@connor4312 connor4312 modified the milestones: October 2022, On Deck Oct 25, 2022
@bpasero
Copy link
Member Author

bpasero commented Nov 8, 2022

I think we cannot convert our CommonJS style files to TypeScript because our tsconfig declares to use AMD in the output. We have a few top level JS files for that reason but it would be great to use TS instead:

image

//cc @alexdima @mjbvz

@connor4312
Copy link
Member

This was easier than I thought since js files bypass compilation. Will require a yarn watch restart

@connor4312 connor4312 modified the milestones: On Deck, January 2023 Dec 12, 2022
@connor4312 connor4312 added bug Issue identified by VS Code Team member as probable bug debt Code quality issues labels Dec 12, 2022
connor4312 added a commit that referenced this issue Jan 6, 2023
* debug: allow setting breakpoints in plain .js files

Fixes #159684

* fixup! don't change sourceURLs in build
@vscodenpa vscodenpa added unreleased Patch has not yet been released in VS Code Insiders insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Jan 6, 2023
@bpasero
Copy link
Member Author

bpasero commented Jan 25, 2023

👏

@bpasero bpasero added the verified Verification succeeded label Jan 25, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Feb 20, 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 debt Code quality issues debug Debug viewlet, configurations, breakpoints, adapter issues insiders-released Patch has been released in VS Code Insiders papercut 🩸 A particularly annoying issue impacting someone on the team verified Verification succeeded
Projects
None yet
4 participants