Wildfires and lack of affordable housing—these are two of the most visible and urgent crises facing California, raising the question of whether the country’s dreamiest, most optimistic state is fast becoming unlivable. Climate change is turning it into a tinderbox; the soaring cost of living is forcing even wealthy families into financial precarity. And, in some ways, the two crises are one: The housing crunch in urban centers has pushed construction to cheaper, more peripheral areas, where wildfire risk is greater.

California’s housing crisis and its fire crisis often collide in what’s known as the wildland-urban interface, or WUI, where trailer parks and exurban culs-de-sac and cabins have sprung up amid the state’s scrublands and pine forests and grassy ridges. Roughly half of the housing units built in California between 1990 and 2010 are in the WUI, which has expanded by roughly 1,000 square miles. As a result, 2 million homes, or one in seven in the state, are at high or extreme risk for wildfire, according to one estimate from the Center for Insurance Policy and Research. That’s three times as many as in any other state…

One solution to the state’s twin problems is to build more dense housing in urban areas: An aggressive infill-building push would lower rental prices and shift the state’s population to less fire-prone areas, as well as help reduce carbon emissions. California Governor Gavin Newsom has signed a number of measures to boost construction and hold down housing costs, and legislators are pushing many more ambitious policies. But the state is far, far away from satisfying the demand for housing, and the climate is only getting hotter.

In the meantime, California isn’t doing enough to discourage building in fire-prone areas.