4

When I select Launch Apex Replay Debugger in VS Code it asks me to select a log file and then gives me this error message:

Cannot read property 'name' of null

I've managed to get the Apex Replay Debugger to work once and since that I get this error.

launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch Apex Replay Debugger",
            "type": "apex-replay",
            "request": "launch",
            "logFile": "${command:AskForLogFileName}",
            "stopOnEntry": true,
            "trace": true
        }
    ]
}

My salesforcedx-vscode-apex.java.home is set in the user settings to:

  "salesforcedx-vscode-apex.java.home": "C:\\Program Files\\Java\\jdk1.8.0_172"

Any ideas how to fix this?

3
  • 1
    I've had the debugger wig out on me a few times before. Usually, a restart/reload of VSCode fixes that. Are you able to see/use any of the other SFDX commands through the command palette (like SFDX: Turn On Apex Debug Log For Replay Debugger)? Care to share your salesforcedx-vscode-apex.java.home value from your user settings?
    – Derek F
    Commented Jan 16, 2019 at 17:58
  • 1
    Also, what's your launch.json look like for the debugger? (project root/.vscode/launch.json)
    – Derek F
    Commented Jan 16, 2019 at 18:01
  • @DerekF a restart of VS Code sorted it. Also I've added my salesforcedx-vscode-apex.java.home setting value
    – Robs
    Commented Jan 16, 2019 at 19:23

1 Answer 1

3

I've had issues in the past with the replay debugger relating to not having my salesforcedx-vscode-apex.java.home set appropriately (the SFDC cli seems to want you to point to the jdk directory itself, not anything inside of it, not even the java executable)

Everything you provided seems to be in order though, so about the only thing that I know of to try at this point is to close and restart VSCode.

The Apex Replay Debugger itself (and probably most if not all of the official SFDX extensions for VSCode) is written in typescript (a superset of plain 'ol Javascript/ECMAScript), which means it's being executed/interpreted/rendered by Electron & Chromium. The github repo for the apex replay debugger is here if you're interested. If there's a hiccup in Electron/Chromium, then a restart is probably the only practical way of "fixing" it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .