I have created a message channel in VS Code. When I attempt to deploy from the package.xml file I receive this error: "No source backed components present in the package".

When I attempt to deploy the xml file itself I receive this error: "Could not infer a metadata type".

Does any know what this means? I appreciate anyone's help with solving this.

  • This almost certainly means the file is the wrong folder, and so the correct datatype couldn't be determined. Make sure the xml file is stored in the correct file location. Read this carefully.
    – sfdcfox
    Jul 21, 2021 at 13:30

3 Answers 3


People landing here due to google search may have above error due to other reasons. This Answer talks to the "No source backed components present in the package" error, due to retrieve deploy bug.


If you retrieve just the File, the folder will be present in the source, because that is the correct structure.

but the folder metadata could be missing, if you only retrieved the file. See pic add the folder to the package.xml

However... I retrieved both file and folder, but it failed deploy too, with a "not found in the Zipped directory" error.

This was because I retrieved with the extension in the package.xml which worked, but the extension is not wanted on deploy. I do feel this is a bug due to the need for various extensions should be allowed.

  1. you must retrieve file and folder, to be able to deploy a new file in a new folder.
  2. you must not deploy with the file extension in the Package.xml, otherwise you get a "An object '' of type '' was named in package.xml, but was not found in zipped directory" error.
  3. this may change.
  4. if you experience these errors try a few different setups because sfdx could change how it behaves.

Here is my failure example

enter image description here

My example is for documents but the error was the same, other may land here too.



This error occurs when you create messageChannels folder somewhere else instead 'force-app/main/default'.


I have also found that the "Could not infer a metadata type" error can be thrown if you have some unexpected file saved where it isn't supposed to be.

I had a random non-salesforce related xml file I accidentally saved within the repo, and it gave me this error until I found it and removed it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .