Using firm-level data, we find that a currency depreciation has two opposite effects on exports when firms are indebted in foreign currency: (i) a pro-competitive effect that increases both the amount of exports by firm (the intensive margin) and the number of firms (the extensive margin); and (ii) a balance-sheet effect that forces some firms to exit the export market and decreases the extensive margin. These results both provide an explanation for the negative reactions of trade after recent emerging market crises and document a finance-based empirical microfoundation to the 'exchange-rate disconnect puzzle'.