Wholesale retailer Costco (COST) has been relatively immune to industry pressures crippling the likes of Sears (SHLD) , Macy's (M - Get Report) and J.C. Penney (JCP - Get Report) , to name a few. That could change, however.

On Thursday, Costco posted disappointing 2017 second quarter results, reporting revenue of $29.8 billion, earnings of $1.17 a share and a same-store sales growth of 3%. Wall Street was looking for revenue of $29.9 billion, earnings of $1.35 a share and a 3.2% increase in same-store sales.

Jim Cramer sat down Wednesday with four market experts to talk about how to play the Trump tax plan. Click here to check out their recommendations.

The one sliver of hope investors received was Costco's announcement to hike fees on its 35 million U.S. and Canadian members. The company will raise the price of its Goldstar membership by $5 to $60 a year and its Executive membership by $10 to $120.

Here are the three major risks looming over Costco.

Inflation could be an unwelcome foe. 

Costco's entire business model relies on buying merchandise on the cheap, and selling it at a cheap price to members. With inflation predicted to rise in 2017, the company is at risk of losing its purchasing power and in the process, could see profit margins come under pressure. 

Overall inflation is predicted to rise to an annual rate of 2.5% by the end of 2017, from the 2.1% it was at in 2016, Kiplinger economist David Payne predicted in a recent report, explaining that "a rebound in energy prices from 2016's depressed levels will cause the majority of the pickup."

E-commerce competition isn't going away. 

Driving more online sales, as restructuring attorney Stuart Komrower at Cole Schotz suggests Costco do, is exactly what the wholesale retailer needs to start considering. E-commerce is killing retail, and Costco is not safe from the threat.

Consumers, always hunting for faster and easier ways to shop nowadays, may turn to Amazon (AMZN - Get Report) rather than Costco to buy items such as TVs, bulk cleaning supplies and shampoo with a Prime membership, which costs $99 a year, now slightly cheaper than Costco's Executive membership.

Costco sells certain items on its e-commerce site, but consumers have to wait three to five business days to receive their purchases, compared to Amazon which offers its Prime members free next-day shipping, and in 30 cities free same-day shipping.

On Thursday's earnings call, Costco CFO Richard Galanti, in response to an analyst's question about investing in e-commerce, said "nothing major" is expected in the near future. 

These tech stocks may be good plays, as a result.

Price wars are heating up.  

Discount retailers Walmart (WMT - Get Report) and Target (TGT - Get Report)  are dropping their prices, which isn't good news for Costco.

While Galanti said Costco is "moving, in some cases, to everyday low pricing, where we can drive higher overall sales and show better value," it will come up against the the companies that dominate the everyday low pricing model such as Target and Walmart. After Target reported weak fourth-quarter results on Tuesday, CEO Brian Cornell said in an interview with TheStreet that it would "make sure we restore the trust in everyday low pricing in key food categories." He said Target is not satisfied "where we are, there is more work to do."

Plus, it was revealed on Monday that Walmart is allegedly intensifying price wars with its rivals. At roughly 1,200 stores in 11 Midwest and Southeastern states, Walmart allegedly launched a new price-comparison test to reduce its prices for consumers even further than they already are. When asked about the test, Walmart spokesman Lorenzo Lopez said "we're always working to deliver lower prices to our customers."

And that should have Costco quaking in their boots.