forcedotcom / salesforcedx-vscode

Salesforce Extensions for VS Code
https://developer.salesforce.com/tools/vscode
BSD 3-Clause "New" or "Revised" License
944 stars 400 forks source link

'Expected double-quoted property name in JSON at position 62273' Code Coverage NOT WORKING #5541

Closed Metic14 closed 2 months ago

Metic14 commented 2 months ago

When running a test and wanting to see the code coverage, i get an error saying expected double quoted property name in JSON at position 62274.

The number isn't important as if you do another test in another file, it changes number.

I've tried downgrading SF CLI, updating it to the newest, uninstalling all extensions, deleting SF and SFDX from my package just to get a new version of it installed... i've done it all. Nothing is working. But - i found the source of the problem --

Under your source folder, you'll have SFDX and SF folders. If you dropdown SFDX you'll get tools, then when into tools, you will find the testresults folder.

Each test that runs will create two new files, one called 'test-result-############-codecoverage.json', and one called just 'test-result-############.json'. the second one is the one that we want to focus on as there seems to be a random comma in the JSON.

Screenshots::

Screenshot 2024-04-17 at 10 03 28

Screenshot 2024-04-17 at 10 04 29

Screenshot 2024-04-17 at 10 06 22

Salesforce Extension Version in VS Code: 60.8.0

SFDX CLI Version: Downgraded to test other versions, updates to newest cli version and still same result. (2.36.8)

OS and version: MAC Sonoma 14.4.1

VS Code version: Version: 1.88.1 (Universal) Date: 2024-04-10T17:42:52.765Z (6 days ago) Electron: 28.2.8 ElectronBuildId: 27744544 Chromium: 120.0.6099.291 Node.js: 18.18.2 V8: 12.0.267.19-electron.0 OS: Darwin arm64 23.4.0

Metic14 commented 2 months ago

FOUND SOLUTION:

Step One: CTRL-SHIFT-P > Disable Extension Auto-Update

Step Two: Uninstall Salesforce Extension Pack (and any other Salesfore Extension Pack, especially apex but this should be included in the Extension pack)

Step Three: Uninstall Salesforce CLI Integration

Step Four: Install Salesforce CLI Integration MANUALLY using VSIX > https://marketplace.visualstudio.com/items?itemName=salesforce.salesforcedx-vscode-core&ssr=false#version-history Version 60.5.1

Step Five: Install Salesforce Extension Pack MANUALLY using VSIX > https://marketplace.visualstudio.com/items?itemName=salesforce.salesforcedx-vscode Version 60.5.1

Step Six: UNINSTALL Apex Extension - first uninstall Apex Interactive Debugger and Apex Replay Debugger before (As for some reason - this still stays at the most updated version)

Step Seven: Install Apex MANUALLY using VSIX > https://marketplace.visualstudio.com/items?itemName=salesforce.salesforcedx-vscode-apex

Step Eight: Exit VS Code completely and start again.

NOTE: Sometimes this doesn't always work as code-coverage sometimes disables itself in the user settings after Uninstalling Salesforce CLI. Make sure to enable it again!

peternhale commented 2 months ago

@Metic14 thank for filing the issue. What you are seeing is a known bug being tracked with issue #5534. Please follow that issue for updates.