You need to sign in to do that
Don't have an account?
SFDX: Deploy Source to Org failed to run in VS Code
I have been trying to deploy apex classes to a Trailhead Playgound as well as a developer org, but I receive the error "SFDX: Deploy Source to Org failed to run" in VS Code.
Did I miss something when I set-up VS Code?
This is the Salesforce CLI output:
Starting SFDX: Deploy Source to Org
11:35:46.868 sfdx force:source:deploy --sourcepath c:\Salesforce\VSCodeQuickStart\force-app --json --loglevel fatal
11:35:48.630 sfdx force:source:deploy --sourcepath c:\Salesforce\VSCodeQuickStart\force-app --json --loglevel fatal ended with exit code 1
Any help would be much appreciated!
Did I miss something when I set-up VS Code?
- Salesforce CLI is up to date
- All extensions are up to date
- The orgs in question have been authorized successfully
- The CLI appears to be installed correctly (when I run "sfdx" in the Terminal, I receive the Salesforce CLI menu)
This is the Salesforce CLI output:
Starting SFDX: Deploy Source to Org
11:35:46.868 sfdx force:source:deploy --sourcepath c:\Salesforce\VSCodeQuickStart\force-app --json --loglevel fatal
11:35:48.630 sfdx force:source:deploy --sourcepath c:\Salesforce\VSCodeQuickStart\force-app --json --loglevel fatal ended with exit code 1
Any help would be much appreciated!
Greetings to you!
The code might have some errors. You can try solving the errors, shown in the error log and then try pushing it again.
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas
Unfortunately, VS Code is not detecting any errors. I simply copied the AccountController class from the Trailhead module (https://trailhead.salesforce.com/en/content/learn/projects/quickstart-vscode-salesforce) and changed the orgName in project-scratch-def.json to "Learning VS Code" as instructed by the Trailhead module.
@StephenDickson,
Where you abale to solve this? I'm also stucked with the same error
It's been so long that I can't remember. I think it may have been due to the fact that I didn't have test coverage. Does that make sense for your situation?
Peace,
Stephen
The only workaround I have found is to close all edit windows, close the folder, reopen the folder, let it reconnect and reauthorize the org and (attempt to) deploy again. That (usually) works unless there's a further problem (possibly in a dependent class) that wasn't detected until the original error was resolved, but it's (a) a time consuming workaround since you have to wait for the org to reauthorize after reopneing the folder, and (b) a real PITA to have to shut everything down and start it up again to find out if you've sufficiently appeased the SFDX gods.
This appears to be a disconnect between VS Code and the Apex compiler which fails to recognize the problem in the first place. Simple syntax errors (missing semicolon, mistmatched brackets, etc) that can be detecetd by the linter are flagged and listed in Problems. But anything more subtle than that is missed until you deploy. As far as I know, I have all the latest SFDX and CLI patches, but to date none of them have resolved the issue.
It should look like this :-
I was having same issue with completing this module (https://trailhead.salesforce.com/en/content/learn/projects/quickstart-vscode-salesforce), I simply copied the AccountController class from the Trailhead module and changed the orgName in project-scratch-def.json to "Learning VS Code" as instructed by the Trailhead module. The error was due to I did not create apex class using command pallate ( ctrl+shift+p)
The syntax of the file name should be as: <messageChannelname>.messageChannel-meta.xml
What I was doing was: <messageChannelname>-meta.xml
Once I corrected it the issue was solved.
Hope this helps you 😊
My issue was that I had renamed the object I was working with. I had updated all of my other files to replace the references to the old object name, but forgot to update the .xml file.
Resolved steps:
1. Reconnect VS code with your sandbox or ORG
2. Maybe your line of counts has been exceeded for that particular file try decreasing some lines .
- I had "Salesforce Exetension Pack".
- I added the "Salesforce Exetension Pack (Extended)"
- Then Deployed the bikeCard Component, It worked.
<targets>
<target>lightning__AppPage</target>
<target>lightning__HomePage</target>
</targets>
This has worked for me. Hopefully it will work for you.
In js-meta.xml file, i changed the <isExposed> value from False to True
This worked for me.
Steps:
1. I have created aura component
2. Created a BoardPanel.cmp file
Which is available in the attached screenshot.
Can anyone please help here to resolve this issue.
Thanks,
Mohan