Frida Ghitis is a world affairs columnist for The Miami Herald and World Politics Review, and a former CNN producer and correspondent. The views expressed in this commentary are her own.

(CNN) When Emmanuel Macron, France's moderate centrist candidate, won Sunday's presidential election against his fiery nationalist opponent Marine Le Pen, he confirmed a trend that should worry right-wing populists -- especially those working in the White House. In an ironic twist, Donald Trump's rise to the presidency -- which was supposed to usher in a sweep of victories for like-minded candidates -- is ruining their chances for success.

To be sure, Macron's victory was the result of countless factors, some of them unique to France. But one of the reasons Macron won is that French voters were horrified at the prospect of electing their own version of Trump. Le Pen reminded them a bit too much of the new American president, a man they strongly dislike.

Trump has low approval ratings in the United States, but it's nothing compared to his ratings in France. A recent poll found an astonishing 82% of French voters have unfavorable views of Trump. That's even worse than Putin's dismal 70.9%.

Trump's election in the United States was supposed to help other populist politicians across the Atlantic. Instead, it is tripping them up.

The West is a battleground

The French election, like any political contest, was a local affair. But it was also a microcosm of a larger battle raging in Western democracies. The West has become a battleground for nationalist populists, who rile up the crowds and stoke their discontent and fears by blaming their countries' woes on outsiders, on immigrants, on bad trade deals and on international organizations that erode the countries' sovereignty. They are facing off against "small L" liberal democrats, politicians who advocate democratic freedoms, tolerance, equality, international trade and active participation in international organizations.

The nationalists have enjoyed good relations and strong (we're still trying to find out how strong) support from Russian President Vladimir Putin. They would like to see the European Union dismantled, a goal Putin rightly views as weakening the West.

In the United States, Trump campaigned as a nationalist populist. (He is not governing as he campaigned, but that's another story.) His victory sparked a wave of euphoria among Europe's populists.

Steve Bannon, Trump's ideologically-charged strategist, presumably still wants to see the nationalist revolution sweep across the West. But the euphoria that followed Trump's election has been followed by grim news for his European soul mates.

Europe's anti-immigrant leaders made the pilgrimage to the United States, delirious about Trump. The Dutch anti-Muslim leader Geert Wilders attended the Republican convention. The UK's Nigel Farage, head of the anti-EU party UKIP, was all smiles at Trump Tower just after the election, with Trump recommending that he be appointed ambassador to the United States. Then there was Le Pen, who was spotted in the Trump Tower lobby a week before the inauguration. White House Press Secretary Sean Spicer, said her presence had nothing to do with Trump. But she was meeting with a man named Guido Lombardi, a resident of Trump Tower, who described himself as a liaison between Trump and Europe's far-right leaders.

Right up to the inauguration, the nationalists had much to celebrate. But the Trump embrace has turned into a Trump curse. Let's just say they're not tired of winning.

Stunned by the United States under Trump

I've been spending time in European countries as voters prepare to go to the polls, and what I have found is that many people are simply stunned -- and not in a good way -- about what they see in the United States. As a result, nationalists are losing altitude.

In the Netherlands, Wilders' Party for Freedom (PVV) started soaring in the polls after Trump's election. His motto, "Make the Netherlands ours again," deliberately emulated Trump's "Make America great again." The PVV held only 15 seats going into the election. By January 20 it was polling to win 41 seats , a stunning figure by the standards of the Netherlands' fragmented multi-party parliament. But then Trump took office. The headlines in the Netherlands showed massive demonstrations at US airports in support of immigrants. The nightly news showed to slack-jawed viewers an American president calling the media "the enemy of the people" and blatantly lying . The PVV's lead started to evaporate.

The election became a referendum on Trump. On Election Day, the lead was gone. The PVV won 20 seats. A big gain from the last election, but less than half what it had polled before Trump became President.

In the UK, Farage's UKIP has slipped in the mud. In local elections last week the party was wiped out even in the areas where it had traditionally done well. Its only member of parliament has stepped down. The party, according to former members, is finished.

Then there's France.

Follow CNN Opinion Join us on Twitter and Facebook

Echoes of US election

Much about the French election was reminiscent of America's, from the xenophobia and the anti-refugee, anti-Muslim rhetoric, all the way to the massive hacking and release of emails from the Macron campaign, an act that appears linked to Russia. A Kremlin-linked bank, incidentally, helped finance Le Pen's campaign.

But it is also clear that Le Pen was hurt by her association with Trump. When I asked French voters about Le Pen, somehow the name Trump kept coming up. Some parties deliberately labeled Le Pen "the French Trump." Political posters melded the two politicians' faces, making Trump and Le Pen look like the same person and urging voters "Don't Trump yourself." In an atmosphere where more than eight in ten voters dislike Trump, that wounded her.

Le Pen did not become president of France, but she did finish second in a field of 11 candidates. That's an achievement and a sign that the battle between the competing philosophies is not over, and that she tapped into concerns that Macron must address. That message applies beyond France.

Some of the issues at the core of populist agendas are legitimate and deserve to be addressed. In some ways, nationalists have made significant gains. They have already moved the entire political spectrum further to the right. Some of their losses have come because their rivals have co-opted their causes. But major questions remain unresolved, including the workings of the European Union, the best way to deal with migration pressures, and the right response to what many perceive as threats to local values.

It seems palpable that the West is living through a crucial moment in its history. More elections loom ahead in Europe, including in Germany, and the Trump administration is just getting started in the United States. The trend so far strongly suggests that Trump has become a liability for nationalists. But the larger contest is far from over -- even if Steve Bannon's vision of a nationalist revolution across the West, piloted by his boss, is crashing into the rocks.