President Trump came in for much jeering when he told reporters he had “inherited a mess” from President Barack Obama. On the economy, though, Obama did indeed leave behind a hidden mess: a seemingly healthy jobs market dependent on cheap debt.

When this debt bubble bursts, just as the last one did, the manufacturing jobs Trump wants to save will be in even greater peril.

The country’s last bubble was in housing. Between 2000 and 2007, Americans nearly doubled their mortgage debt, from $5.9 trillion to $10.6 trillion.

This didn’t bother anyone in a position of power. The housing boom created millions of jobs, from construction to home-furnishing, and people felt rich.

What bothered the pols was when the illusion broke.

Since the 2008 crash, neither Democrats nor Republicans have been interested in creating a sturdier economy. Instead, they’ve built up another bubble, this time in the car and SUV industry.

How? The same way: cheap debt. In 2010, Americans owed $809 billion on their cars (after adjusting for inflation). Today, they owe nearly $1.2 trillion, according to the New York Fed.

And the rate of growth has been accelerating: Last year alone, Americans borrowed $93 billion to buy cars (after accounting for people who repaid such debt); 2016 was “the highest auto loan . . . year in the 18-year history of the data,” Fed researchers said, not entirely enthusiastically.

People with great credit have been buying new SUVs because interest rates have been at record lows. As interest rates rise, they’ll pull back, but perhaps not that much. By definition, they can afford to pay a little more.

But who is borrowing for used cars — and at much higher interest rates — is a huge concern.

People with not-great credit scores have always made up about a fifth of the auto-loan market.

But the percentage of people borrowing even though they have really bad credit scores has surged, reports Bloomberg. It’s now a third of the subprime auto-bond market, up from just 5 percent seven years ago.

A Standard & Poor’s analysis of just one big subprime auto bond tells the story. Last week, a company called DriveTime, which sells used cars in 26 states to people with bad credit, was in the market to issue $442 million worth of bonds backed by auto loans.

The average credit score of borrowers was 538 — indicating a history of serious default. And, as S&P notes, “today’s subprime customer appears to be . . . weaker . . . than that of several years ago,” because people who defaulted right after the housing crash at least had the excuse that they were caught up in a global bubble.

These loans are for people who have no choice but to borrow to buy a car, and no bargaining power on the interest rate they pay: close to 20 percent.

Even though the borrowers pay through the nose, they depend on cheap global credit. With interest rates still near record lows, lenders have to take ever more risk in a low-interest-rate environment to make a little money. As for that risk: Delinquency rates are rising, with 4.32 percent of subprime borrowers in general at least 60 days late last year, up from 3.52 two years earlier, says S&P.

The bigger risk here isn’t the risk to investors, though. The auto-loan market is still much smaller than the housing market, and the investment world hasn’t created trillions of dollars of derivative securities based on this market (at least not that we know of). And unlike with houses, no one ever expects the value of a car to increase with use.

No, this bubble presents a much more direct risk to the economy — and manufacturing jobs. If people with terrible credit can’t borrow an average of nearly $18,000 to buy a used car (what the DriveTime customer pays), the market for used cars collapses.

That, in turn, affects the market for new cars. Indeed, the US auto industry has seen sales decline this year, after clocking half a decade of record highs.

That’s bad news for the 946,300 Americans who work in the nation’s auto-manufacturing industry. Car-makers have been adding jobs since 2009, when the industry hit a low of 653,300 workers. But over the past year, they’ve added only 2,400 workers, down from the 40,300 people they added the previous year.

If the auto-credit market sputters out during Trump’s first term — and it’s hard to see how it won’t — Trump would be justified in blaming his predecessor.

But he’ll face the same bad options previous presidents have. No one has quite figured out how to fix this economy without a lot of short-term pain.

Nicole Gelinas is a contributing editor to the Manhattan Institute’s City Journal.