It's been said that history doesn't repeat, but it often rhymes. There has been excitement around several major innovations throughout history, such as the dot-com bubble in 2000, when the internet's earliest days caused an unquenchable thirst for tech stocks.

Microsoft (MSFT -2.80%), one of the market's darlings at the time, swelled to more than 70 times its earnings, a valuation that suppressed investment returns for years after the bubble burst. Had you bought shares at that time, it would have taken more than 15 years to get back to even.

The tale reminds me of what's happening to Nvidia (NVDA 3.97%) today. While I don't think Nvidia will put investors underwater for 15 years, the stock has become a potential trap for investors looking to chase the hype. Here is what you need to know.

This sounds familiar...

It's not that Microsoft's business didn't perform for 15 years; quite the contrary. The company's earnings-per-share (EPS) increased by 266% between 2000 and 2015, slowly burning off the stock's eye-popping valuation from years back.

Investors should also be careful how far out they look when predicting the future. Even though Microsoft was one of Earth's best businesses and the long-term results stand on their own, the year-to-year journey was bumpy at times. Recessions and other challenges can pop up without much warning.

MSFT PE Ratio Chart.

MSFT P/E Ratio data by YCharts.

Today, it seems like Nvidia can do no wrong. One can acknowledge that Nvidia's guidance was enormous and that the long-term growth opportunity in AI could fuel much growth moving forward. But increasingly, more success is priced into the stock as the share price climbs.

NVDA P/E Ratio Chart.

NVDA P/E Ratio data by YCharts.

You can see that Nvidia's business has already shown ups and downs in recent years -- both revenue and profits have declined over the past few years. Remember that Nvidia is a semiconductor company, an industry that is traditionally cyclical and sensitive to economic ups and downs. Analysts and investors expecting years of straight-line upward growth should adjust their expectations.

What are investors signing up for at today's prices?

Nvidia briefly touched a trillion-dollar market cap in May, though it's since backed down a bit. In other words, it's now one of the world's largest companies. Big numbers can act like gravity, pulling down harder as the numbers move higher.

Buying the stock at this valuation could be a problem, even factoring in generous growth. For example, consensus analyst estimates call for Nvidia to earn $20 per share in the fiscal year 2028 (ending in January). That's a price-to-earnings ratio (P/E) of about 20 at the current share price.

Nvidia's stock would have to trade meaningfully above that to generate substantial investment returns between now and the next four to five years. That's not factoring all that could go wrong along the way, including recessions and competition that could easily throw up roadblocks to growth.

That's not to say it can't happen, but investors are jumping into the stock without a margin of safety, at the very least. 

What should investors do?

The fear of missing out is a heck of a drug. Share prices of Nvidia are up more than 150% since January. They aren't likely to continue rocketing like this as a near-trillion-dollar company with less than $5 billion in profits over the past four quarters.

Nvidia could be the world's most successful company over the next five years, and it wouldn't matter if you bought the stock at the wrong valuation. Consider waiting for a pullback on the stock. If you can't wait, at least buy a little at a time, a strategy called dollar-cost averaging.

Fast gains can stoke the human emotions that hurt investors the most damage -- fear and greed. Keep a clear head and look at the facts so you don't jump into a bad situation with two feet.