Uncertainty about the riskiness of a new financial environment was an important factor behind the U.S. credit crisis. We show that a boom-bust cycle in debt, asset prices and consumption characterizes the equilibrium dynamics of a model with a collateral constraint in which agents learn "by observation" the true riskiness of the new environment. Early realizations of states with high ability to leverage assets into debt turn agents overly optimistic about the probability of persistence of a high-leverage regime. Conversely, the first realization of the low-leverage state turns agents unduly pessimistic about future credit prospects. These effects interact with the Fisherian deflation mechanism, resulting in changes in debt, leverage, and asset prices larger than predicted under either rational expectations without learning or with learning but without Fisherian deflation. The model can account for 69 percent of the rise in net household debt and 53 percent of the rise in residential land prices between 1997 and 2006, and it predicts a sharp collapse in 2007.