salesforcedx-vscode icon indicating copy to clipboard operation
salesforcedx-vscode copied to clipboard

Checkpoints can be set on a valid line of Apex source. Invalid checkpoint location:

Open mjaggard opened this issue 2 years ago • 8 comments

Summary

Identical problem to #1476 however I do not have any special characters in my path

The line I'm setting the checkpoint on is in a Test class and reads my__MyAccount__c myAcc = new my__MyAccount__c(); although I've tried on several lines in several files. I have also checked that the latest version of my source has been deployed correctly in Salesforce. I've restarted VS Code. I've updated to the latest versions.

Steps To Reproduce:

  1. Create as project based on exisiting code in a packaging org
  2. Set a breakpoint on a valid line in a valid cls file
  3. Attempt to run Replay Debugger

Expected result

Replay debugger should work

Actual result

Starting SFDX: Update Checkpoints in Org
SFDX: Update Checkpoints in Org, Step 1 of 6: Retrieving org information
SFDX: Update Checkpoints in Org, Step 2 of 6: Retrieving source and line information
There is no line breakpoint informatin for the current project
SFDX: Update Checkpoints in Org, Step 3 of 6: Setting typeRefs for checkpoints
Checkpoints can be set on a valid line of Apex source. Invalid checkpoint location: URI=file:///Users/mat/dev/BillForwardPackaging/force-app/main/default/classes/CreateSFAccountTriggerHandlerTest.cls, Line=16
Ending SFDX: Update Checkpoints in Org
Your checkpoints have errors. Fix the errors listed in the output, then run SFDX: Update Checkpoints in Org again.
16:05:15.790 ended Debug Test(s)

Additional information

Salesforce Extension Version in VS Code: VS Code: 1.66.1 Salesforce Extension: v54.7.0

SFDX CLI Version: sfdx-cli/7.139.0 darwin-x64 node-v16.14.0

OS and version: MacOS 12.3.1

mjaggard avatar Apr 12 '22 15:04 mjaggard

Hi @mjaggard, I see one of the steps you call out is to be working in a packaged org. Are you try to use the replay debugger with managed code? For managed code you'll need the ISV debugger.

randi274 avatar Apr 14 '22 15:04 randi274

I don't think so but I'm new to Salesforce. The code was created in this org but I have created a managed package.

mjaggard avatar Apr 14 '22 17:04 mjaggard

Got it, so that org was just a regular scratch org, or a dev org? Both of those should work fine, as long as the code in the org isn't managed. In that case, can you try creating a new project and see if you run into the same issue with a new class?

randi274 avatar Apr 14 '22 19:04 randi274

I'm having the same issue in a dev org. I tried the fixes in #1476, like removing the number from the name of the project. I also created a new project with a different name, and a new class to no avail.

Salesforce Extension Pack v54.9.0

Salesforce CLI: 7.147.1-1633b17

VS Code: Version: 1.66.2 (user setup) Commit: dfd34e8260c270da74b5c2d86d61aee4b6d56977 Date: 2022-04-11T07:46:01.075Z Electron: 17.2.0 Chromium: 98.0.4758.109 Node.js: 16.13.0 V8: 9.8.177.11-electron.0 OS: Windows_NT x64 10.0.18363

m-lp-ql-m avatar Apr 25 '22 20:04 m-lp-ql-m

I was doing some testing of this today - is anyone seeing stale Checkpoints in the checkpoint tab? I ran into this today, and was able to resolve the issue by:

  • Deploying everything to the source org to make sure the code is current. (As a sanity check, you can also retrieve from the org to make sure there's no inconsistencies!).
  • Open the 'Run and Debug' tab from the left side. Open the Checkpoints dropdown, shown in the image below, to see if there are stale checkpoints (which there were, for me).
  • Manually locate and remove the checkpoints.
  • Using the command palette or the button in the Checkpoints header to run SFDX: Update Checkpoints in Org
  • Insert a new checkpoint using SFDX: Toggle Checkpoint
  • Update checkpoints in org, and that should be working again.

Screen Shot 2022-07-20 at 1 17 00 PM

Let me know if this fixes it for you as well @mjaggard @m-lp-ql-m

randi274 avatar Jul 20 '22 17:07 randi274

I'm afraid I'd tried all those steps before. I can only think that the problem is something in my Developer edition org - I just wish I had some way to debug it to be confident - data sent to and from the server or detailed logs.

mjaggard avatar Jul 20 '22 18:07 mjaggard

Oh, also just for clarity - when you say managed do you mean installed from a package created in some other org? In my case the code IS managed because I'm developing an app which I've done a release of but this is the org I'm developing in and creating releases in.

mjaggard avatar Jul 20 '22 18:07 mjaggard

Yep, that's exactly what the managed code would be! The difference for the VS Code extensions is that it can only see the code that you're allowed to see. So if you're able to view the class on the dev console, you should be able to set checkpoints/breakpoints using VS Code too (if the class is hidden or not visible, then you wouldn't be able to set them).

randi274 avatar Jul 20 '22 18:07 randi274

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

github-actions[bot] avatar Oct 20 '22 02:10 github-actions[bot]

you need review all the folder and subfolders name and remove spaces or special characters

Angeldpg1010 avatar Aug 07 '23 23:08 Angeldpg1010

Yep, that's exactly what the managed code would be! The difference for the VS Code extensions is that it can only see the code that you're allowed to see. So if you're able to view the class on the dev console, you should be able to set checkpoints/breakpoints using VS Code too (if the class is hidden or not visible, then you wouldn't be able to set them).

Then yes, I can see the code so that's not the problem I guess?

mjaggard avatar Aug 08 '23 07:08 mjaggard

you need review all the folder and subfolders name and remove spaces or special characters

Please read the first line of the bug report.

mjaggard avatar Aug 08 '23 07:08 mjaggard

My solution: Close VS Code, delete .sfdx/tools folder, start VS code. Now debugging works again.

kenhov avatar Nov 09 '23 13:11 kenhov

@kenhov 's solution worked for me. I have a local path, no special characters or spaces, but could not get checkpoints and by extension the replay debugger to work unless I followed his advice.

takumaCeo avatar Feb 14 '24 20:02 takumaCeo