This error happens because TDS projects are deployed in wrong order. Order is especially important for Templates and Items that are inherited from these templates.
Projects execution order is defined in *.sln file as set of dependencies between projects. If project1 depends on project2, than project2 is deployed first.
VS detects these dependencies automatically for C# projects when you reference one project from another. Unfortunately, content projects like TDS does does not have code level references and dependencies has to be set manually.
To do that, perform steps below in Visual Studio:
- Right click on Solution in Solution Explorer
- Pick Properties
- Navigate to Project Dependencies
- Define Dependencies as necessary
Your Core packages should go first, next should be DEV packages that include Templates, Renderings, Placeholder Settings and etc. Your Content packages (Packages and Data) should be very last.