SFDX: diff file against org
See original GitHub issueSummary
I updated Salesforces extensions for vsCode and I installed “sfdx-diff” (https://forcedotcom.github.io/salesforcedx-vscode/articles/user-guide/source-diff). When I tried the “SFDX: diff file against org” on an apex class connected to a dev org, I had this error : “TypeError [ERR_INVALID_ARG_TYPE]: The “path” argument must be of type string. Received type undefined”. But It works on the UAT or on the production org of the same project… It works also on the dev org of another project.
Steps To Reproduce:
- Reload extensions to be updated in VsCode.
- Run “sfdx plugins:install @salesforce/sfdx-diff” in terminal inside vsCode.
- Result @salesforce/sfdx-diff… installed v0.0.2
- Try right-click and “SFDX: diff file against org” on an apex class.
Expected result
I should be able to make a diff between my local changes and my org.
Actual result
Error and no diff displayed.
Additional information
Feel free to attach a screenshot.
Statck with loglevel info: "stack": "Error: The file that you tried to diff isn't in a package directory that's specified in your sfdx-project.json file. Add this location to your \"packageDirectories\" value, or diff a different file. For details about sfdx-project.json, see: https:/e. For details about sfdx-project.json, see: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_ws_config.htm\n at Function.isValidPackageSource (C:\\Users\\xxxx\\AppData\\Lo\\validations.js:29:19)\nOuter stack:\n at Functical\\sfdx\\node_modules\\@salesforce\\sfdx-diff\\lib\\validations.js:29:19)\nOuter stack:\n at Function.wrap (C:\\Users\\xxxx\\AppData\\Local\\sfdx\\node_modules\\@salesforce\\core\\lib\\sfdxError.js:151:2\sfdxCommand.js:269:67)",7)\n at Diff.catch (C:\\Users\\xxxx\\AppData\\Local\\sfdx\\node_modules\\@salesforce\\command\\lib\\sfdxCommand.js:269:67)"
It doesn’t work on the dev org but It works on the UAT or on the production org of the same project… It works also on the dev org of another project.
VS Code Version: 1.37.1
SFDX CLI Version: 46.11.0
OS and version: Windows 10
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:11 (4 by maintainers)
Top GitHub Comments
@Ewaken @lcampos @RandallFlagg I had the same error too. And then execute the [SFDX:Authorize an Org] again, this problem will be resolved.
Hello @lcampos, Thank you for your answer. That’s not the case, here is my sfdx-project.json for all my projects:
{ "packageDirectories": [ { "path": "force-app", "default": true } ], "namespace": "", "sfdcLoginUrl": "https://login.salesforce.com", "sourceApiVersion": "46.0" }
And for one project (so I don’t change anything on my project, I only log on a different org), the command works for my uat + prod orgs but not on my dev org…