Daily Learnings: Fri, Feb 02, 2024
Give whatever you are doing and whoever you are with the gift of your attention. — Jim Rohn
How to Fix VS Code Debugging for Apex
I’ve had intermittent issues with updating my checkpoints from VS Code to a given Salesforce instance for debugging purposes. Sometimes I’ll get hit with an error in the Output panel that says something like the following:
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/john/Developer/some-project/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)
Yet, my checkpoint is indeed on a valid line of Apex. Super frustrating.
Thank heavens for the internet and Github Issues. kenhov posted his solution here:
- Close VS Code
rm -rfthe.sfdx/toolsdirectory- Restart VS Code