When Yahoo announced last year that it had lost $42 million reviving NBC’s TV series “Community” and launching two other original shows, the company framed it as a failed experiment. It didn’t work, so Yahoo was cutting its losses.

But those in the entertainment industry were scratching their heads: How could the company call it quits without spending more?

Netflix, after all, had spent $100 million on its first attempt at original programming — two seasons of “House of Cards.” Amazon spent $3 billion last year on content for its Prime video and music streaming service, double what it spent in 2014.

“This is a go big or go home business,” said Brian Wieser, an analyst with Pivotal Research Group. “Call me when you’ve invested $4.2 billion in content, then it gets interesting.”

Yahoo’s comparably small expenditure differs from the strategy embraced by the companies that dominate streaming entertainment. But those familiar with the Sunnyvale, Calif., firm say it illustrates a recurring stumbling block.

The firm has long struggled with its identity, flip-flopping between its roots as a technology company and its ambitions of becoming a media giant.

With the company now up for sale — Yahoo is reportedly looking at a second round of bids sometime this month — it’s still unclear, after all these years, what Yahoo really is.

Yahoo started as a guide to the Internet, steering early explorers of the World Wide Web to the most interesting sites around. As the Internet matured, Yahoo grew into a portal, offering search, email, news, entertainment and anything else around which it could sell advertising. But when the portal model fell out of favor, firms like Yahoo struggled to adapt.

Newcomers have since eclipsed nearly every facet of Yahoo’s tech business. Google long ago won search. For nearly a decade, Facebook has owned social. Everyone else won mobile.

Media has been the place where Yahoo has staked, and then retracted, its claim.

The company has Yahoo Finance and News — long-running websites that for years have drawn huge amounts of traffic (the company’s collective websites drew 205 million visitors in March this year, according to Comscore, putting Yahoo behind only Google’s sites and Facebook). But each of Yahoo’s attempts to grow beyond that — to be a hub for original scripted entertainment — have ended with it pulling back and pivoting elsewhere.

“Yahoo had the ability to be a transformational media company,” said Peter Csathy, chief executive of consulting firm Manatt Digital. “It has all the assets you’d need to be successful — massive reach, globally known brand, some high-quality content, and a sales team that has been effective — but it was never able to tie those pieces together.”

In 2004, the company hired former ABC executive Lloyd Braun to head up its Santa Monica media group, which was tasked with creating original programming that could give Hollywood a run for its money.

Braun, who had green-lighted shows such as “Lost,” “Desperate Housewives” and “Grey’s Anatomy” at ABC, helped Yahoo launch original programming such as the daily video compilation show “The 9” and the multimedia website “Kevin Sites in the Hot Zone.”

But within two years, the company changed course. Its foray into television-style programming was now described by Braun in an interview with the New York Times as being “salt and pepper on the meal” as opposed to Yahoo’s main attraction. Instead of creating its own content, it would lean on other media companies and content generated by users.

Shortly after that, Braun left the company. He declined to be interviewed for this story.

Yahoo’s most recent attempt at entertainment media came after Chief Executive Marissa Mayer joined the company in 2012.

With revenue declining and mounting pressure from Wall Street to show financial and user growth, Mayer implemented a multi-pronged turn-around strategy that has included workforce cuts; product launches; a revamped email app; investments in mobile, social and advertising; and a $1.1-billion acquisition of Tumblr.

A key part of her strategy was a return to entertainment media.

She hired news anchor Katie Couric on a $10-million-a-year contract, secured an exclusive live-streaming deal with the NFL and committed funding to original programming: the revival of “Community” and two new series,” Sin City Saints” and “Other Space.”

On an earnings call with investors in 2014, Mayer said that “premium content draws premium advertisers” and, to that end, Yahoo was experimenting with original scripted shows. “We are thrilled by the positive response from ‘Community’s’ passionate following, and we are excited to welcome those fans to Yahoo,” she said.

A year later, all three shows were canceled.

“We couldn’t see our way to make money over time,” Kenneth Goldman, Yahoo’s chief financial officer, said during a 2015 earnings call, when he revealed the company had lost $42 million on those shows. “We’re not saying we’re not going to do these at all in the future, but in [these] three cases at least, it didn’t work the way we had hoped it to work, and we decided to move on and basically write off those assets.”

In January, Yahoo shut down its video portal, Yahoo Screen, and Mayer announced that the company was shifting away from original scripted content.

“While some investments have become essential to Yahoo’s transformation, others have not,” she said earlier this year. “We’ve taken an honest look at those bets, and have chosen to re-prioritize many sources towards more proven areas of growth.”

But Yahoo kept Couric, now on a $15-million contract, even though its news website remained a hodgepodge of links to other news providers. And it kept four digital magazines – with a focus on news, sports, finance and lifestyle — while shutting down the rest. It launched an e-sports portal this year.

“Again,” Csathy said, “a head scratcher.”

Yahoo insiders can point to a handful of smart bets the company has made — an exclusive licensing deal with “Saturday Night Live,” NFL streaming, live music streaming for instance. But its aversion to risk, they say, meant it always pulled back before it could see results.

“Ultimately, Yahoo had this opportunity,” Csathy said. “And the world passed it by.”