SFDX not pushing

UPDATE: I was able to fake it out by creating another new class that did nothing, but when I ran:

sfdx force:source:status

It showed up, along with the real class I wanted to move. I was able to push them both, then delete the dummy class.


Another option is to use sfdx:force:deploy instead of sfdx:force:push to get the source into your target org, once it's deployed you should be able to then use push normally

sfdx force:source:deploy -u [username/alias] -p force-app/ 

I've got the same issues as you. Sometimes when there is compilation error in the component, it's not deployed but Salesforce registers it as up to date with scratch org. It's not possible to deploy it anymore until you make a change.

One workaround is to make a white space change in the class, dx should notice the difference and let you deploy it.

In my case, I've had to migrate fields from other (non-dx) environment. Deployment failed, but DX still thought fields are on scratch org :) I've had to delete fields locally, "push" deletion and then restore the fields and push again.

Another irritating thing I've encountered - deployment to new org failed...partially. Some classes have been deployed, others did not and I have not way to say which ones are not on the org.

Tags:

Salesforcedx