IN THE Lithuanian town of Panevezys, a shiny new factory built by Devold, a Norwegian clothing manufacturer, sits alone in the local free economic zone. The factory is unable to fill 40 of its jobs, an eighth of the total. That is not because workers in Panevezys are too picky, but because there are fewer and fewer of them. There are about half as many students in the municipality’s schools as there were a decade ago, says the mayor.

Such worries are increasingly common across central and eastern Europe, where birth rates are low and emigration rates high. The ex-communist countries that joined the European Union from 2004 on dreamed of quickly transforming themselves into Germany or Britain. Instead, many of their workers transported themselves to Germany or Britain. Latvia’s working-age population has fallen by a quarter since 2000; a third of those who graduated from university between 2002 and 2009 had emigrated by 2014. Polls of Bulgarian medical students show that 80-90% plan to emigrate after graduating.

Lithuania’s loss of workers is costly, says Stasys Jakeliunas, an economist. Remittances and EU money for infrastructure upgrades have helped, but labour shortages discourage foreign investment and hurt economic growth. According to the IMF, in some countries in eastern Europe emigration shaved 0.6-0.9 percentage points from annual GDP growth in 1999-2014. By 2030 GDP per person in Bulgaria, Romania and some of the Baltic countries may be 3-4% lower than it would have been without emigration.

All of this imperils public finances. Pensions, which take up about half of social spending in eastern Europe, are the biggest worry. In 2013 Latvia had 3.3 working-age adults for each person older than 65, about the same as Britain and France; by 2030 that is projected to fall to just over two, a level Britain and France will not reach until 2060. Countries are raising the retirement age (apart from Poland, which is recklessly lowering it). Benefits are already meagre, leaving little room for cuts. As a share of GDP, social spending in Bulgaria, Romania and the Baltic states is roughly half of that in many richer European countries.

Unable to dissuade people from leaving, governments are trying instead to lure them back, inspired by successful efforts in Ireland and South Korea. Daumantas Simenas, project manager of the Panevezys free economic zone, credits his return from Britain to the country’s “Create for Lithuania” programme, which matches educated professionals from the diaspora with government jobs. Having a job already lined up made the decision to return easier, he says. Plus, he adds, “home is home.”

Whether such efforts can turn the tide seems doubtful. “Create for Lithuania” has brought back more than 100 people since its launch five years ago, says Milda Darguzaite, who started the programme after leaving an investment-banking career in America for a government post in Vilnius. Returnees include an MP, a deputy mayor and several advisers to the prime minister. Bringing back doctors and engineers, however, is trickier. Studies show that skilled workers from eastern Europe are attracted abroad primarily by the quality of institutions such as good schools; better social benefits matter more for unskilled migrants. Data on return migration are scanty, but a recent report by the IMF suggests it has been “modest”, in some countries as low as 5% of those who left.

Firms are adapting to labour shortages. At a recent business conference in Bulgaria, employers said they are having to raise wages to entice workers from farther and farther away. In Bulgaria and the Baltic states wages have grown faster than productivity for the past five years—a trend that makes exports less competitive.

That may change. Higher labour costs are pressing firms to automate, says Rokas Grajauskas, an economist at Danske Bank. On the factory floor at Devold many tasks once done by hand, such as cutting cloth into shapes for winter pullovers, are now executed by robots.