Tech stocks had never been higher. Then Facebook reported earnings. Thursday's going to be ugly.

Facebook's (FB) stock tumbled as much as 24% in after-hours trading Wednesday, after its chief financial officer warned that its sales growth would slow.

Concerned that the problems facing Facebook aren't unique, investors sold off the whole tech sector Wednesday evening. Twitter fell 6%. Amazon and Google were down 2%. Microsoft and Apple fell 1%.

Tech stocks have been on fire in 2018, lifting the broader market along with them. The Nasdaq hit another record high Wednesday, and it's up 15% this year.

Related: Facebook 'puts privacy first' and stock plunges 20%

The best-performing stocks in the S&P 500 read like a list of apps on your phone: Netflix (NFLX) is up 86% this year. Twitter (TWTR) is up 76%. TripAdvisor, AMD, Amazon, Adobe and Salesforce are all in the Top 20.

Just two days ago, the tech sector looked like it may never come down again. Google's earnings were great, even after it got hit with a $5 billion antitrust fine from the European Commission. Last week, Microsoft said its cloud business is going gangbusters.

These are healthy companies, and investors are looking for growth in a market that has been rattled by a looming trade war. Automakers got rocked Wednesday after revealing that steel and aluminum tariffs were crushing their bottom lines. Whirlpool, Harley-Davidson and many other manufacturers reported they had a rough quarter.

Compared to those manufacturers, Facebook is extremely healthy, too. Its sales soared 42% between April and June.

But Facebook's revenue badly missed Wall Street's expectations, and its warning about slower sales growth in the future freaked out investors.

Ross Sandler, an internet analyst at Barclays, called Facebook's deceleration "fairly dramatic."

Some of the issues are Facebook-specific, including changing the way it promotes content on its network. But Facebook said its customers are demanding better privacy protections after the fallout from the Cambridge Analytica scandal. The company said it plans to put "privacy first," which could hurt traffic.

The privacy issue could be a problem for Google (GOOGL), Apple (AAPL), LinkedIn-owner Microsoft (MSFT) and especially Twitter.