SACRAMENTO — Just before a committee of California state senators voted on a landmark bill to ramp up housing production by overriding local resistance, legislator after legislator talked about a dire affordable-housing crisis that demanded bold action and a marked increase in new building.

Then they killed the bill.

The vote here on Tuesday evening highlighted the emergence of California’s housing and homeless problem — and the fraught question of how to address it — as a potent election-year issue that promises to dominate the state’s politics for years.

The ferocity of that debate was on display throughout a meeting of the State Senate’s Transportation and Housing Committee, which met to vote on a divisive bill that would force local governments to accept higher-density projects around transit centers like train stations.

The bill, called S.B. 827, was introduced by Scott Wiener, a Democrat from San Francisco, and would have allowed developers to build five-story condominiums and apartment buildings near rail stops, even if local governments and zoning codes prohibited developments of that size.