A shift in egg buying has left one of the top suppliers in the U.S. scrambling to recoup its former profits.

Shares of Cal-Maine Foods dove 7 percent Monday after the company reported its first annual loss in more than 10 years.

The Jackson, Mississippi–based company announced a $74.3 million loss for fiscal year 2017, including a net loss of $24.5 million in its fourth-quarter.

The loss in the fourth quarter was 51 cents a share, more than double what analysts had expected, according to FactSet.

Cal-Maine says its flocks have been replenished after the 2015 avian influenza outbreak, which contaminated mass amounts of hens domestically. CEO Dolph Baker said the new populations are "more productive," generating an even greater quantity of eggs per hen.

Yet market demand has not returned to match the increasing supply. A surge in the popularity of egg alternatives — such as flax seed, silken tofu or a replacement made of potato and tapioca — are cutting into Cal-Maine's demand. Baker says those vegan-friendly options exacerbate the oversupply, pushing prices down further.

As Cal-Maine waits for the oversupply to lessen, Baker said his company will continue to focus on the "specialty egg business," which includes cage-free eggs.

Cal-Maine shares are now down more than 22 percent this year.