We are looking to move and migrate to Salesforce DX, and I've been playing around with the cli / tools and following the steps provided in the developer guide.
We have a few managed packages, along with some custom apps being built in our dev org. I have created an unmanaged package using the package manager and added the App, which inherently added all of the dependencies (custom objects, fields, Lightning Components, Visualforce pages, etc).
I've been having a hard time pushing the retrieved metadata source to my scratch org. When I run the command I get tons of errors most of which seem inaccurate:
- Class not existing (even though it does exist)
- Variable does not exist
- In field: field - no CustomField named
- Apex class 'Name of Class' does not exist
- We couldn't validate your component. Review it and try again. The following code has invalid references which caused safe validation failure. AuraDefinition [id:null deftype:null format:null source:null] (0:0)
Among many others. I've searched around extensively and it seems I must fix each of these issues, however some of them just don't really make sense as to what exactly the issue is.
Is this due to lack of data, and the code not properly handling such conditions. Or is it because the source push is not doing it in the right order?
I would just like some guidance or insight as to what steps I must take to be able to replicate a component, module or app into the scratch org, keeping in mind that there are a lot of dependencies. Why is this happening and what must I do to resolve it? Hopefully this was clear, thank you.