9

Deploying any updates via VS Code salesforce extension can take 5-10 minutes. Restarting of VS code helps for 2-3 first deploys and then the issue comes back.

Deployment Status at org says, that deployment finished successfully, but VS Code still shows the "Running SFDX: Deploy Source to Org" notification.

Reinstalling SFDX-CLI and VS Code doesn't help.

How to solve this issue?

4 Answers 4

12

There is a bug on salesforce github repo: Deploy Source to org command takes several minutes to complete.

For now the workaround is to downgrade SFDX CLI extension in vscode to a lower recommended version: v57.10.2.

Use Install Another Version option as per screenshot below: enter image description here


My prefered option is to disable salesforce's deploy on save use CLI directly but manually running deploy command everytime is little tedious.

To automate this, I like to use Save and Run vscode extension, using which I configure custom deploy on save command with below setting in .vscode/settings.json file on my workspace:

{
    "saveAndRun": {
        "commands": [
            {
                "match": "force-app/*",
                "isAsync": true,
                "cmd": "time sf project deploy start --source-dir '${file}' --ignore-conflicts"
            }
        ]
    }
}

Note: I run SF retrieve before working on a file, hence I ignore conflicts with --ignore-conflicts flag, discard it if you want to see conflicts with save.

1
  • 1
    I have set up a ctrl+alt+d to deploy. Its muscle memory now like blinking and takes about the same time. Better than usual manual deploy.
    – Dane
    Feb 22 at 9:49
1

check what do you have in setup / apex settings / Perform Synchronous Compile on Deploy

we had this issue when this setting was set to true, deployment of any apex class would take 3-5 min

1

For me, disabling this setting in vs code did the job.

{
   "salesforcedx-vscode-core.experimental.enableSourceTrackingForDeployAndRetrieve": false
}

enter image description here

1
0

This might be related to the Apex settings. Disable the synchronous compile option. enter image description here

You must log in to answer this question.

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