T O UNDERSTAND Swedish politics, consider the trash in Stockholm. Busy Stockholmers who want their clutter lugged to distant recycling centres can download an app that connects them to casual workers who will do it cheaply and straight away. Tiptapp, the “Uber for trash”, is popular not only among time-poor professionals but also among the legions of refugees who cannot find jobs. Tens of thousands have offered their services.

Stockholm has responded by banning Tiptapp, though the ban is not being enforced while Tiptapp appeals. The city argues that rubbish collection is a government monopoly—which perhaps explains why the official contractors are so unhelpful. When Johan Norberg, a local columnist, tried to get a Tiptapp-like service from one, he was told it would cost roughly 20 times as much, take up to five days and only happen during office hours, when he is not at home.

Between 2013 and 2017 Sweden let in 353,000 refugees, equivalent to 3.5% of its population. It has failed woefully to integrate them. Red tape makes it hard for them to find jobs. After five years in the country only 40% of male refugees and 20% of female ones are working. For native-born Swedes of either sex, the figure is nearly 80%. Combined with large handouts, this means that refugees tend to drain the public purse. And this avoidable policy error has helped to poison Swedish politics.

The Sweden Democrats ( SD ), an anti-immigrant party, warns that newcomers will bankrupt Sweden’s welfare state. The SD won 17.5% of the vote in a general election in September, up from 13% in 2014 and 0.4% 20 years ago. The traditional centre-right and centre-left alliances each have roughly 40%. So a party with neo-Nazi roots holds the balance of power.

This creates a dilemma. The government has already made it much harder for new asylum-seekers to enter Sweden. But the mainstream parties hesitate to embrace the SD itself. To do a deal with the nationalists would lend them respectability. But if the mainstream parties form a grand coalition to exclude the SD , it would become the only serious opposition, and protest voters would have nowhere else to go. Either way, the SD stands to gain.

How worrying is that? As it has grown, the SD has expelled its most openly racist members, and its more virulent youth wing has split away. But it remains a magnet for those who dislike Muslims, railing against polygamy and crimes committed by immigrants.

On November 14th Ulf Kristersson, the leader of the Moderate party, the largest in the centre-right Alliance, failed to form a government. Parliament rejected his attempt, after his own allies deserted him when it became clear that the SD would vote to allow hin to form a minority government—not, it appeared, as part of any explicit deal he had reached with them. “This is the most serious crisis I’ve been involved in all the years I’ve been in politics,” Mr Kristersson said. If after four formal votes there is still no government, a fresh election will have to be held.

It is unclear what the Sweden Democrats are after. Mostly, they just want mainstream politicians to sit down with them. Some pundits even argue that a share of power might force them to become more responsible, as has happened in Norway. Others, though, predict that they would play the centre-right and centre-left off against each other, threatening to support the other side’s budget if their demands for ever-more-draconian migration curbs are not met.

Support for the SD has grown “on the back of unsolved problems the big parties have not addressed”, says Mr Kristersson. Getting migrants into work will be “difficult but not rocket science”, he says; it will require a mix of better education and new types of jobs for the unskilled.

He is right. Refugees are typically less educated than Swedes, and just starting to learn Swedish. Many are not worth hiring at prevailing wages, which unions can enforce with intimidating tactics such as organising workers at an errant firm’s suppliers to shut down deliveries. All this makes it hard for unskilled workers to price themselves into a job. Such problems can hardly be tackled without a government.

This article was amended on November 16th to make clear that Tiptapp remains operational pending its appeal.