Or you can have lots of immigration and a per capita contracting economy like France.
France population 1990: 58 million | France population today: 67 million
France GDP 1990: $1.2 trillion | France GDP today: $2.9 trillion ($1.2t inflation adjusted forward 32 years is $2.7 trillion)
They gained 15-16% in population, and gained 6-7% in GDP. A big net drop per capita over such a duration, particularly for a major affluent economy.
And if one wants to be more aggressive about how big of a failure their immigration program has been, the French economy has net contracted in real terms over the last 15 years. GDP was $2.9t at the peak in 2008, and it's still there now; except to just remain steady, it needed to climb to nearly $4 trillion to adjust for inflation. So France has gained 5% in population over ~15 years, and is missing a trillion dollars in GDP they should have just to remain flat (ie they've seen a massive per capita economic contraction over those 15 years).
One might claim the decline in France would have been even worse without their hefty immigration policies. Likely a false claim given the very high unemployment rate among immigrants in France over the past two decades. The French approach to mass immigration has been a disaster (while other better controlled examples have been great successes, as in Canada). Skilled immigration is vastly better than low-skill mass immigration, especially going into the era of basic human labor coming under attack by the field of productivity robotics. It's a far better approach to focus on improving your nation per capita net via attracting highly skilled labor, in terms of productivity and incomes, than just focusing on getting as much raw immigration as you can. That's the core failure of the French approach.
It's far better to be rich Canada, with a flat to very modestly increasing population, in which real per capita GDP keeps rising and they keep focused on adding high skill labor (which makes their country richer and richer over time), than to be an declining France that throws low skill labor at the problem. For one thing, the high skilled labor immediately begins contributing to the tax base in a big way, which is critical for an affluent welfare state; whereas a tilt toward low skilled labor + a welfare state is a recipe for fiscal disaster.
US GDP per capita is on track to reach a doubling of the French GDP per capita, plausibly this decade ($76k vs $44k now and the gap keeps widening year after year). Meanwhile Canada is also now up to $57k (France and Canada were nearly the same on GDP per capita in 2008, now there is a $13k gap), so they're increasingly leaving France behind as well.