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

Unverified breakpoint in multi-package repo #5951

Closed
nkskaare opened this issue Nov 19, 2024 · 8 comments
Closed

Unverified breakpoint in multi-package repo #5951

nkskaare opened this issue Nov 19, 2024 · 8 comments

Comments

@nkskaare
Copy link

nkskaare commented Nov 19, 2024

Summary

Unable to stop at breakpoints with Apex Replay Debugger in a repo with multiple packages defined in sfdx-project.json.

Steps To Reproduce:

  1. Set breakpoint for a class which is not on the default path "force-app/main/default/classes"
  2. Start debugging session
  3. See that breakpoint is greyed out

Update: Tried reproducing the issue with a simpler project structure than I have in the repo where it is failing, I am currently unable to reproduce, even though I am running in the same devcontainer environment. Any insight into how to further debug this is appreciated.

Expected result

Regular breakpoint, which debugger can be stopped at.

Actual result

Breakpoint is greyed out, saying unverified breakpoint.

Additional information

Screenshot 2024-11-19 at 14 34 46

Salesforce Extension Version in VS Code: v62.5.1

Salesforce CLI Version: @salesforce/cli/2.46.6 linux-x64 node-v18.20.4

OS and version: Ubuntu 22.04.5 LTS (Docker devcontainer)

VS Code version: 1.95.3

Most recent version of the extensions where this was working: v62.5.1 (Unsure. Tried reproducing the issue in the same type of container with a simpler project structure and it worked.)

@svc-idee-bot
Copy link
Collaborator

Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.

@svc-idee-bot
Copy link
Collaborator

Hello @nkskaare 👋 It looks like you didn't provide all the required basic info in your issue.

If you haven't already, please provide the following info:
Salesforce Extension Version in VS Code:
Salesforce CLI Version:
OS and version:
VS Code version:
Most recent version of the extensions where this was working:

Here's an example of a set of required info that will pass the validation:
Salesforce Extension Version in VS Code: 60.13.0
Salesforce CLI Version: @salesforce/cli/2.42.6 darwin-arm64 node-v18.18.2
OS and version: MacOS Sonoma 14.5
VS Code version: 1.89.1
Most recent version of the extensions where this was working: 60.11.0

A few more things to check:

  • Make sure you've provided detailed steps to reproduce your issue, as well as all error messages that you see.
    • A repository that clearly demonstrates the bug is ideal.
    • Error messages can be found in the Problems Tab, Output Tab, and from running Developer: Toggle Developer Tools in the command palette.
  • Make sure you've installed the latest version of the Salesforce Extension Pack for VSCode. (docs)
  • Search GitHub for existing related issues.

Thank you!

@nkskaare
Copy link
Author

Developer tools logs no error when trying to set the breakpoint, but the following error message is displayed when debugging session is finished.

Screenshot 2024-11-19 at 15 34 13

@daphne-sfdc
Copy link
Contributor

Hi @nkskaare, After you switch to debugging a different project and then switch back to your original project, are you still seeing this issue, or is this a one-time thing? We'll be happy to help you debug this issue if it's consistently failing.

Copy link

This issue has not received a response in 3 days. It will auto-close in 2 days unless a response is posted.

@github-actions github-actions bot added the stale label Nov 29, 2024
@nkskaare
Copy link
Author

Yes, this is consistently failing in our project. I also experienced a colleague facing the same issue on a different computer. I am usually working in a remote development container, however he is not.

@nkskaare
Copy link
Author

nkskaare commented Nov 30, 2024

From what I could investigate further. The debug console reports the following:

3157: launchRequest: args={"name":"Launch Apex Replay Debugger","type":"apex-replay","request":"launch","logFile":"/workspaces/breakpoint-reproduce/.sfdx/tools/debug/logs/07LKI000000swRS2AY.log","stopOnEntry":true,"trace":true,"projectPath":"/workspaces/breakpoint-reproduce","__sessionId":"ba312233-64f3-44c3-b4af-64fd4c21c99b"}
Apex Replay Debugger session started for log file 07LKI000000swRS2AY.log.
62.0 APEX_CODE,FINEST;APEX_PROFILING,INFO;CALLOUT,INFO;DB,INFO;NBA,INFO;SYSTEM,DEBUG;VALIDATION,INFO;VISUALFORCE,FINER;WAVE,INFO;WORKFLOW,INFO
3157: setBreakPointsRequest: path=/workspaces/breakpoint-reproduce/src/core/package1/classes/TestBreakpoint.cls uri=file:///workspaces/breakpoint-reproduce/src/core/package1/classes/TestBreakpoint.cls lines=4
3157: setBreakPointsRequest: path=/workspaces/breakpoint-reproduce/src/core/package1/classes/TestBreakpoint.cls verified lines=

I was able to reproduce the issue by introducing some errors in the sfdx-project.json, like a misplaced comma. However, I'm pretty sure the sfdx-project.json in my original project does not have this error. However, what it does have is some additional properties on the different packages under "packageDirectories". This is something introduced by the project build tool we're using. Could this be something that causes the issue?

@nkskaare
Copy link
Author

I was actually able to solve it...

If the "path" is given with a ./ prefix it causes the debugger to not return verified breakpoint lines. Removing the ./ solved the issue, also in my original project.

{
  "packageDirectories": [
    {
      "path": "./src/core/package1",
      "package": "package1",
      "default": true,
      "ignoreOnStage": ["validate"],
      "versionNumber": "0.1.0.NEXT"
    },

@github-actions github-actions bot removed the stale label Dec 1, 2024
@nkskaare nkskaare closed this as completed Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants