This pre-deploy error appears when trying to deploy a change without one of its required dependencies.
What triggers this error?
This error is triggered when Salto calculates a deploy plan, and identifies a new element which has a required dependency but that dependency does not exist in the target environment, nor is it part of the new deployment.
For example, a user may try to deploy a new Apex Class in Salesforce which uses some custom object, but that custom object is not part of that deployment and does not exist in the target environment.
When this error occurs, Salto will skip this element, and it will not be deployed if user decides to proceed.
You can see an element's dependencies by reviewing the "Depends On" tab in the element's view in Explore mode.
How can I solve this?
To avoid this error, make sure that your deployment contains all required dependencies. This can be easily done by reviewing the "Dependencies" tab in the Element Selection view (when deploying from an environment) or in the Clone view (when deploying from a workspace).
When selecting elements for deployment or cloning, the Dependencies tab will always show the Required dependencies for the selected elements. Users also see an alert when trying to proceed without selecting a required dependency:
In order to avoid the "element contains unresolved references" error, make sure there are no unselected required dependencies before previewing a deployment (in environment) or before cloning (in workspaces).