Cannot read property 'fspath' of undefined --> when using a Keyboard shortcut to deploy Salesforce file
See original GitHub issueI added a custom keyboard shortcut to deploy current file using “sfdx.force.source.deploy.current.file” command
One of our business requirements is to figure out a keyboard shortcut that can do Save and compile of Apex classes from VSCode while doing ORG based development. This is very important for us to roll out VSCode and drive adoption of its use for Salesforce development. This feature is currently not available in VSCode and hence I tried adding a keyboard shortcut for the sfdx command but I am running into an issue.
Steps To Reproduce:
- Go to Code --> Preferences --> Keyboard Shortcuts
- Open keybindings.json file
- Add the below command in your keybindings.json file
[ { "key": "shift+cmd+r", "command": "sfdx.force.source.deploy.current.file" } ]
- This is how your keybindings.json file should look like
- Now open an Apex class or Visualforce page or Trigger file and press Shift+Cmd+r
Expected result
The file should have been deployed
Actual result
VS Code Version:
SFDX CLI Version:
OS and version:
Other Commands just work perfectly fine, for e.g.
[ { "key": "shift+cmd+r", "command": "sfdx.force.org.open" } ]
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:58 (18 by maintainers)
Top Results From Across the Web
SFDX ERROR: Cannot read property 'fileName' of undefined.
I am getting an error when trying to do a sfdx retrieve: ERROR: Cannot read property 'fileName' of undefined. Here is the command...
Read more >Error deploying to org: "Cannot read property 'success' of ...
Just had the same error and I found the root cause: when Apex class .cls and .cls-meta.xml file names do not match, CLI...
Read more >Cannot read property 'fsPath' of undefined - Get Help
Hi! :slight_smile: I'm trying to deploy my company's site and I'm getting this error: TypeError: Cannot read property 'fsPath' of undefined ...
Read more >Zayne Turner в Twitter: „@ForceGraells @SalesforceDevs Yes! It's ...
know how to attach a keyboard shortcut in VSCode to "SFDX:Deploy Source to Org", ... Cannot read property 'fspath' of undefined --> when...
Read more >VS Code keyboard shortcut to SFDX: Deploy This Source to ...
... Deploy This Source to Org" in Visual Studio Code, the command fails with the error message "Cannot read property 'fsPath' of undefined" ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
One of my colleagues found a good way to do this:
Output: hit “cmd+shift+b” (in MacOS), it will do
Steps
Save on deploy is going out in our next release.