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

Parent indirection in launch configs cwd results in poor source maps #139086

Closed
ccarcaci opened this issue Dec 14, 2021 · 4 comments
Closed

Parent indirection in launch configs cwd results in poor source maps #139086

ccarcaci opened this issue Dec 14, 2021 · 4 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues verified Verification succeeded
Milestone

Comments

@ccarcaci
Copy link

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

When using the "double-dot parent folder indirection" in launch configuration (see image) the debugger stops working properly with typescript and source maps.

Screenshot from 2021-12-14 13-50-58

  • VS Code Version:
1.63.0
7db1a2b88f7557e0a43fec75b6ba7e50b3e9f77e
x64
  • OS Version:
    Ubuntu Linux Linux ccarcaci-N56JN 5.11.0-41-generic #45~20.04.1-Ubuntu SMP Wed Nov 10 10:20:10 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
    I have the same problem also on OSX on a different machine.

Steps to Reproduce.

Working case:

  1. Checkout this repo https://github.com/ccarcaci/parent-cwd-issue
  2. Select menu entry File > Open workspace from file...
  3. Select the workspace.code-workspace from parent-cwd-issue/single-folder.
  4. Run npm build pointing your console to parent-cwd-issue/single-folder.
  5. Set a breakpoint in the index.ts file.
  6. Open Run&Debug tab.
  7. Launch "single folder" runnable configuration.
  8. Debugger stops correctly on the breakpoint (see image).
    Screenshot from 2021-12-14 13-55-03

Broken case:

  1. Checkout this repo https://github.com/ccarcaci/parent-cwd-issue
  2. Select menu entry File > Open workspace from file...
  3. Select the workspace.code-workspace from parent-cwd-issue/multi-folder/workspace-launch.
  4. Run npm build pointing your console to parent-cwd-issue/multi-folder/service-code.
  5. Set a breakpoint in the index.ts file.
  6. Open Run&Debug tab.
  7. Launch "multi folder" runnable configuration.
  8. Debugger is not stopping correctly at the breakpoint.
  9. Open the file parent-cwd-issue/multi-folder/service-code/build/src/index.js.
  10. Set a breakpoint.
  11. Open Run&Debug tab.
  12. Launch "multi folder" runnable configuration.
  13. Debugger works correctly on compiled code (see image).
    Screenshot from 2021-12-14 14-00-54

What's the difference?
The single-folder package has a launch configuration which uses the cwd default value (I've tried using a path without parent indirection and it works either).

The multi-folder package has a launch configuration which specifies a parent indirection in the cwd setting.

@weinand weinand added the debug Debug viewlet, configurations, breakpoints, adapter issues label Dec 14, 2021
@weinand weinand removed their assignment Dec 14, 2021
@connor4312
Copy link
Member

You'll want to configure your outFiles too by adding:

      "outFiles": [
        "${workspaceFolder}/../service-code/**/*.js",
        "!**/node_modules/**"
      ],

By default, VS Code will only scan the workspace folder for sourcemaps, and this adjusts that. We actually have logic to do this automatically, but it was only activated if a program was set, which is not the case for you.

You also most likely want to remove the disableOptimisticBPs.

@connor4312
Copy link
Member

connor4312 commented Dec 14, 2021

This will be fixed in the next nightly build.

Also, a very topical log statement 😉

@connor4312 connor4312 added the bug Issue identified by VS Code Team member as probable bug label Dec 14, 2021
@connor4312 connor4312 added this to the January 2022 milestone Dec 14, 2021
@ccarcaci
Copy link
Author

TY @connor4312

@rchiodo rchiodo added the verified Verification succeeded label Jan 27, 2022
@rchiodo
Copy link
Contributor

rchiodo commented Jan 27, 2022

/verified

image

@github-actions github-actions bot locked and limited conversation to collaborators Jan 31, 2022
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 verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants