forcedotcom / salesforcedx-vscode

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

Cannot read property 'fspath' of undefined --> when using a Keyboard shortcut to deploy Salesforce file #662

Closed pranaymistry closed 5 years ago

pranaymistry commented 6 years ago

I 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:

  1. Go to Code --> Preferences --> Keyboard Shortcuts
screen shot 2018-10-05 at 9 17 56 am
  1. Open keybindings.json file
screen shot 2018-10-05 at 9 19 37 am
  1. Add the below command in your keybindings.json file

[ { "key": "shift+cmd+r", "command": "sfdx.force.source.deploy.current.file" } ]

  1. This is how your keybindings.json file should look like
screen shot 2018-10-05 at 9 20 54 am
  1. 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

screen shot 2018-10-05 at 9 23 21 am

VS Code Version:

screen shot 2018-10-05 at 9 24 51 am

SFDX CLI Version:

screen shot 2018-10-05 at 9 25 39 am

OS and version:

screen shot 2018-10-05 at 9 26 12 am

Other Commands just work perfectly fine, for e.g.

[ { "key": "shift+cmd+r", "command": "sfdx.force.org.open" } ]

screen shot 2018-10-05 at 9 40 37 am
ghost commented 2 years ago

It appears to be broken again, starting today, when I use a keyboard shortcut to deploy a file it give me an error "Cannot read property 'fsPath' of undefined". But it works well when I right click on file > deploy source to org.

randi274 commented 2 years ago

Hi all - we're taking a look at "Cannot read property 'fsPath' of undefined" with a new issue #3656 - feel free to add any additional details there. (Deploy on save issues we're tracking on #3655 and are currently working on a fix for that one.) Thanks for your comments and patience!

Anaatoole commented 2 years ago

For me just reload twice VS Code worked.

sqone2 commented 2 years ago

For me just reload twice VS Code worked.

Wow that worked for me! Thank you @Anaatoole!

dvon88 commented 2 years ago

@Anaatoole fix did not work for me. Still broken.

randi274 commented 2 years ago

@dvon88 are you on v53.4.2 of the extensions? If so and it's still an issue, please file a new issue so we can track the problem separately. Thanks!

dvon88 commented 2 years ago

@randi274 I am on 53.4.2 and was on that version when I posted earlier today, but it was fixed only after I updated the CLI today. Since it appears to be fixed, it's probably fine but it appears to not be perfect based on this. I updated the CLI from 122 to 124. Don't remember the rest of the version numbers, but that's all that fixed it for me.

8bit-cutie commented 2 years ago

Still experiencing this issue, I verified that everything is up to date (SF CLI, vscode, etc)