Learning by exporting refers to the mechanism whereby firms improve their performance (productivity) after entering export markets. Although this mechanism is often mentioned in policy documents, a significant share of econometric studies has not found evidence for this hypothesis. This paper shows that the methods used to come to the latter conclusion suffer from a large internal inconsistency: they rely on an exogenous evolving productivity process. I show how recent proxy estimators can accommodate endogenous productivity processes such as learning by exporting. I rely on my framework to discuss the bias introduced by ignoring such a process and how adjusting for it can lead to detect significant productivity gains upon export entry. I estimate my model on standard firm-level data and find substantial additional productivity gains from entering export markets.