View photos A shop assistant talks to customers in front of a sales sign on display at a retail store. May 3, 2017. REUTERS/Steven Saphore More

Fewer jobs were created than expected during the month of December with the retail sector, in particular, taking a plunge.

“The obvious weakness was in retail, which shed 20,300 jobs. That could be just noise or a consequence of the shift from bricks and mortar stores to online,” Capital Economics chief U.S. economist Paul Ashworth wrote in a note on Friday.

Ashworth continued: “As a comparison, couriers & messengers added only 2,100 jobs, so in net terms the structural shift is hardly positive for employment.”

In other words, the jobs being created amid the shift to online shopping may not be offsetting the jobs that are being destroyed.

Within the retail trade category, the biggest loser was department stores, which dropped 8,200 jobs in December compared to November followed by general merchandise stores, which shed 19,100 jobs versus November.

As for categories that would be tied to the rise of e-commerce, in particular giants like Amazon (AMZN), non-store retailers saw a slight gain of 200 jobs in December. The transportation and warehousing category saw an increase of 1,800 jobs.

For the entire year of 2017, the retail trade lost 67,000 jobs after creating 203,000 in 2016, according to the BLS.

Overall, 2017 was a challenging year for the sector. Nearly 8,000 retail stores were closed, according to a list compiled by UBS.

View photos

Sears Holdings (SHLD) announced on Thursday that it would close 103 unprofitable Sears and Kmart stores, while Macy’s (M) released a list of 11 stores that it would be shutting down in 2018.

In a new report from Moody’s Investors Service, the retail industry will also likely see continued defaults ahead in 2018, but it shouldn’t be as bad as 2017.

“After a particularly difficult year, the US retail and apparel industry is bracing for more defaults and rating downgrades in the next few months,” said Moody’s Vice President, Christina Boni. “That said, we expect defaults among speculative-grade retailers to drop sharply to 5% in October from 9% today, but only after peaking at 11% in March.”

Julia La Roche is a finance reporter at Yahoo Finance. Follow her on Twitter.