In the pursuit of ever increasing efficiency and growth, our economies have evolved to remarkable degrees of complexity, with nested production processes feeding each other in order to create products of greater sophistication from less sophisticated ones, down to raw materials. The engine of such an expansion have been competitive markets that, according to General Equilibrium Theory (GET), achieve efficient allocations under specific conditions. We study large random economies within the GET framework, as models of complex economies, and we find that a non-trivial phase transition occurs: when the fraction of non-primary goods, i.e. goods that result as an output of a production process, exceeds a critical threshold, the economy freezes in a state where all production processes collapse. As in other examples of phase transitions in large random systems, this is an unintended consequence of the growth in complexity. This suggests that the Industrial Revolution can indeed be regarded as a sharp transition between different phases, but it also implies that well developed economies can collapse if too many intermediate goods are introduced.