Retailers are grappling with growing pains as e-commerce grows