Between 1904 and 1942 , Ecuador lost territories in a series of conflicts with its neighbors .