Until the late 1990s, China was a nation of cyclists. Bicycles were such a vital part of everyday life that in the 1970s, owning one was a prerequisite for marriage the way an apartment and a car are for Chinese men today. A massive “bicycle army” rolled through the streets of Beijing every morning like a flowing Great Wall. Then, from 1995 to 2002, the government created bicycle-reduction policies in order to encourage the growth of the auto industry and usage of the mass transit infrastructure. But when the SARS epidemic hit, public transport became associated with disease and danger, sparking an even bigger rush toward cars in cities. Today, Chinese metropolises have some of the worst traffic gridlocks in the world.

Bike-sharing apps seemed poised to be the solution—and millions of bikes were poured into China’s streets by the private sector in the last three years. But today, as the companies fail, unused units pile up in bicycle graveyards, and queues of angry users demand their deposits back, it’s obvious just how doomed the idea was from the start. The rise and fall of the China bike craze played out like a sped-up version of every tech bubble, an unprofitable idea sustained by fantasy, false predictions, and the power of bigger firms.

Local authorities struggling with traffic have been trying to put residents back on two wheels. As early as 2007, docked bike-shares were introduced by municipal governments to alleviate mobility issues in cities such as Beijing, Hangzhou, and Wuhan, but users found accessing bikes via docking stations to be inconvenient, and the services failed to thrive.

The bicycle rental company Ofo was created in 2014 as a Peking University school project, and Mobike was found in the following year, both capitalizing on the shortcoming of all docked bike-sharing services: that the stations limited access and spontaneity, two essential joys of cycling. The “little red bikes,” as Mobikes came to be known, soon appeared on the street corners of Shanghai, ready to be discovered via a GPS-enabled mobile app, and rideable with just a 299 yuan deposit, about $45, via mobile payment. The little yellow Ofo bikes soon followed suit by spreading beyond campuses, eventually joined by around 60 other start-ups.

The image sold by the firms was fresh and upbeat, riding on the same bright-eyed enthusiasm for the potential of mobile technology that helped the mobile payment app Alipay, the e-commerce platform Taobao, and the social media app WeChat become staples of Chinese life. Users wanted both a cheap way to get across town and the freedom of cycling. For the government, the bike-share boom was both an opportunity to become a world leader in climate change and also harkened back to a happier, simpler, and more harmonious time when China was the kingdom of bicycles. Mobike’s slogan, “Bring bicycles back to the city,” captured why the program was appealing to local authorities, who at first were willing to give firms a lot of freedom to experiment and grow. While Mobike and Ofo blazed the trail, dozens of other firms such as Bluegogo and Xiaoming Bike sprung up.

But cars were not going to be banished from the streets, and it wasn’t long before cyclists took mostly to the sidewalks. It took even less time for haphazardly parked bikes in a multitude of colors to begin clogging the sidewalks, already made too narrow by makeshift parking lots and scooter traffic. By 2017, in Beijing and Shanghai, where the bikes were most concentrated, there were parts of the city where streets resembled urban obstacle courses made of bikes that citizens had to clamber over and maneuver around. Trucks were deployed daily to collect improperly parked bikes, and workers to stack bikes neatly. Despite efforts to manage the bikes, they were like a brightly colored rash that increasingly drew the ire of both citizens and local authorities.

But at first users and investors alike assumed that this over-saturation was just a stage in the industry, just like what mobile payments and food delivery had gone through. Consumers were happy at the dirt-cheap prices as companies raced to the bottom to draw numbers. Many start-ups were flat-out giving out free rides in an all-in bid to win users, and consumers only too happily enjoyed all the perks while small companies quickly burned through their modest stockpile of investor money and disappeared. As various players began to bow out, there were instances of people not being able to recover their deposits from bike companies that went bankrupt, ominous foreshadowing for things to come for Ofo in 2018.

Between June and November 2017, Kuqi Bikes, Bluegogo, Dingding Bikes, 3Vbikes, and Wukong Bikes all shut down, unable to pay suppliers, maintain operations, or return deposits.

It was always unclear how the firms were ever supposed to be profitable. According to analysis published by Xinhua, each bike costs just over $200 to manufacture and $10 for each tuneup by a technician, and they made a profit of just 1 yuan, about 15 cents, per 2 hour ride, following a deposit of between $15 and $45. The mainstream view— pushed heavily by investors—was that the user data, rather than the service, was the actual product, and that the harvested user data would lead to more targeted advertising. But as so often occurs, these ambiguously defined long-term returns yielded nothing in the endless interim. There was no short-term return on investment for the companies to stay afloat, and the smaller players began to fall in droves.

Between June and November 2017, Kuqi Bikes, Bluegogo, Dingding Bikes, 3Vbikes, and Wukong Bikes all shut down, unable to pay suppliers, maintain operations, or return deposits. Around the same time, local authorities began to roll back their initial tolerance by imposing new restrictions and fines. This wasn’t the first time that start-ups that had previously relied on government lenience had run afoul of new legislation: Didi, China’s Uber equivalent, lost most of its driver pool after cities began to demand that its workers hold a valid local residence permit.

As governments tightened up, cyclists found themselves being hit with fines for riding on the sidewalk across cities of all sizes. In May, the 15th Beijing Municipal People’s Congress imposed fines on bike-share companies for improperly parked units, and more cities soon followed suit. At a neighborhood level, signs forbidding bike-share cycles went up on apartment complex gates, in commercial districts, and even in public parks.

In these bloody battles for market share and user data sustained by bonfires of money, only those with the deepest pockets can hope to emerge victorious. In the early days of bike-share investment, money poured from a wide range of sources, such as venture capital firm Black Hole Capital and game developer Elex Technology, which both backed Bluegogo, and peer-to-peer investment company Pufa VC (whose CEO backed his son’s bike-share, Dingding Bikes). Throughout 2016 and 2017, barely a week went by without a new announcement on bike-share investments. Mobike began by raising capital from multiple venture capital firms such as Sequoia Capital, Sinovation Ventures, and Panda Capital, before Tencent joined the fray. Early Ofo investors include Xiaomi and Didi Chuxing, later joined by Hony Capital, Citic Private Equity, and Alibaba’s Ant Financial, before the Alibaba parent company followed suit.

And yet, at the end of every cycle of life and death for the latest tech bubble, it always seems to come down to Alibaba vs. Tencent, China’s two biggest tech giants. User and user data acquisition has much more strategic value for their ecosystems to come up with increasingly targeted services and platforms. Alibaba staked food delivery and video streaming platforms. Only Alibaba and Tencent have the heft to operate bike-shares at a loss just to acquire geolocation user data.

In April, Mobike was saved from its financial struggles when it was acquired by Tencent-backed Meituan Dianping, an online-to-offline e-commerce and food delivery super-app, itself a product and survivor of the tumultuous tech landscape and the brief fad for coupon services. This abruptly launched the bike-share wars into the endgames. Mobike’s newfound financial stability allowed it to pull the rug out from under its remaining competitors by getting rid of the deposit entirely. Even then, Mobike is now a grizzled survivor that has lost its luster. Today it operates with a greatly reduced fleet, and much of its overseas expansions has petered out.

Meanwhile, Ofo was suffering dire cash flow problems, struggling to pay suppliers and keeping operations afloat, and concentrating all its efforts on putting out fires rather than growing the business. Earlier this year, Ofo halted its costly and overly aggressive expansions abroad to focus on the domestic market—which placed on display the limitations of its own financial reach and its leaders’ utter lack of a plan. After a missed opportunity to merge with Mobike and a failed Didi acquisition, Ofo stands on the brink of financial ruin, its only lifeline an Alibaba buyout that may never come. Sensing the end of the bike wars, disgruntled people lined up outside Ofo’s office in Beijing clamoring for their deposits to be returned while the digital queue for withdrawing one’s deposit reached as long as 13 million users.

Despite the ongoing Ofo crisis, Hellobike has just raised 4 billion yuan, more than half a billion dollars, from Primavera Capital and Alibaba’s Ant Financial. It seems that there are still some who hasn’t woken up from the bike-share fever dream.

Meanwhile, Shanghai is adding more docking stations, perhaps a return to the boring, but infinitely more manageable, version of the bike-share. There’s always going to be a small audience for cycling—but it turned out to be a bad dream to build giant firms on.