[SalesForce] Unexpected file found in package directory

I've worked on developing ligthing component using sfdx and till some point everything worked fine. Today I got latest changes from my git repo and tried to make sfdx force:source:push but it failed with a message Unexpected file found in package directory: path_to_my_source\force-app\main\default\classes\MyCustomApex.cls. I spent some time investigating this but at some point of time I decided to start from the scratch but still got the same exception. Here is what I did:

  1. Cloned my repository to the new folder
  2. Authorzied in DevHub trial using sfdx force:auth:web:login -a DevHub -d -s
  3. Created new scratch org using sfdx force:org:create -a MyNewOrg -s -f config/project-scratch-def.json
  4. Installed Lightning Test Service using sfdx force:lightning:test:install

Now I try to push my cloned sources into the scratch org using sfdx force:source:push but keep getting this error. I tried to checkout the version that for sure had only my code and worked for me but the error remained. Am I doing something wrong? Did I miss anything?

Best Answer

Still don't know the root cause, but reinstallation of SFDX CLI helped (no changes of the source code)

Related Topic