IT WAS a holiday weekend of high political drama in Illinois as lawmakers scrambled to avert a humiliating downgrade to junk status of their state’s bonds by credit-rating agencies. “For me today, right here, right now, this is the sword that I am willing to die on,” proclaimed Michael Unes, one of the Republican state representatives who voted for the revenue and spending bills passed over the weekend by the Democratic-run House of Representatives. Several other Republican lawmakers broke into tears as they voted for tax increases they opposed ideologically but felt are needed to avoid a fall into the financial abyss. Fifteen Republican members of the house broke ranks with Bruce Rauner, the governor, who categorically refused to back the House bills.

Illinois was one of 11 states that failed to meet the deadline for passing a budget. Connecticut, Delaware, Maine, Massachusetts, New Jersey, Oregon, Rhode Island and Wisconsin were all without budgets on July 1st. In Pennsylvania and Michigan, the budget was on the governor’s desk. Illinois’s budget stalemate has been by far the longest, adding to the state’s reputation for shoddy government. But in two other states with a divided government, New Jersey and Maine, the failure to agree on a spending plan caused moments of tension and absurdity, too.

From July 1st to 3rd, state parks, beaches and government offices were closed by a partial government shutdown in New Jersey because Chris Christie, the Republican governor, wanted to tap the funds of the state’s largest health insurer. His constituents were hopping mad when they saw photos of the governor lounging with friends and family on a pristine beach off-limits to everyone else (a scene captured from the air by an enterprising local paper, the Star-Ledger). In Maine, where government also partly shut down, state workers demonstrated outside the state house on July 1st, chanting “Do your job!” Maine’s Republican governor, Paul LePage, had refused to sign the budget because he opposed an increase of the state’s lodging tax.

Governors Christie and LePage signed budget deals after three-day stand-offs with their respective legislatures, with Mr Christie defiantly stating that he was going back to the infamous beach. Their midwestern counterpart refused to budge. After state senators approved the House bills on July 4th, Governor Rauner vetoed them as soon as they reached his desk. Senators swiftly voted to override the governor’s vetoes. The Speaker of the House, Michael Madigan, promised the House would follow suit on July 6th.

Illinois is an extreme example of a more general phenomenon, as states across the country grapple with declining revenues (see map). The state has not had a budget for two years. The governor and the Democratic-run legislature have engaged in brinkmanship: the governor insists that any spending plan must include some of his proposals, including a property-tax freeze, legislative term limits and a reform of workers’ compensation insurance. Democrats retort that these reforms would hurt the middle class.

Meanwhile, Illinois’s operating budget deficit has grown to 0.6% of GDP, though the state constitution says the budget must be balanced. The backlog of unpaid bills reached $16bn and total debt $210bn. The state has seen eight downgrades of its bonds by credit-rating agencies, the last of which, in early June, made them fall to just one notch above junk—with a negative outlook. “If Illinois does not agree on a budget plan, there is a greater than one in two chance that we will downgrade the state’s credit rating to below investment grade,” warned Gabriel Petek of Standard & Poor’s, a credit-rating agency, before the holiday weekend. That would make future borrowing much more expensive. The imminent danger of a junk rating for Illinois’s bonds seems to have cooled the trench warfare between the governor and lawmakers. But the conflict has already done lasting damage to the Land of Lincoln. Providers of state-funded social services that help the mentally ill, the elderly, victims of domestic violence and those infected with HIV have not received any funds from the state for two years. Many have folded or are running reduced operations. The next in line would be schoolchildren. Without a budget, some schools downstate and in the suburbs will not be able to reopen after the summer. Illinois is in a league of its own, but many states are under similar pressure. State revenues have not recovered since the financial crisis, says John Hicks of the National Association of State Budget Officers. Thirty-three states have had to revise their revenue forecasts downwards in the past year. The main reasons were lower receipts from sales taxes and income taxes, which account for half of state revenue. Sales are shifting online, prices of tangible goods are falling and consumption is tilting towards services, all of which diminishes sales-tax revenue. Income-tax receipts were lower than expected because pay for many jobs is still below pre-recession levels, and growth in the stockmarket in 2015 and early 2016 was sluggish. Ill-advised tax cuts played a role, as did lower energy prices, which affected Alaska, Louisiana, Oklahoma and West Virginia. The tighter-than-expected squeeze on state finances is fuelling an unusually high number of budget battles this year, but so is greater political polarisation over fiscal policy. As political donors and primary voters have become more pugnacious, they expect politicians they back to fight harder, says David Gamage at Indiana University. As a result government shutdowns, which were extremely rare 30 years ago, have become more frequent both at the federal and state level.

Uncertainty over fiscal policy can harm economic growth, sapping investors’ confidence. To deal with the growing problem of government shutdowns and budget stalemates, Mr Gamage proposes, in a paper he helped write, the adoption of default budget policies along the lines of those in place in Wisconsin and Rhode Island. Under this arrangement, if lawmakers cannot agree on a spending plan the latest budget remains in effect until they can.

It is a tidy solution, though sceptics argue that it would allow governments to avoid passing budgets and thus duck hard choices. This has not been the case in Wisconsin and Rhode Island, which have generally taken no longer than other states to pass a budget. This year is an exception: as The Economist went to press, both states were still without a budget. Yet thanks to their default policies, both states’ governors could head to the beach without fear of mockery.