WASHINGTON — Republican leaders began the problematic task of finding support for an immigration compromise Wednesday, telling lawmakers that President Donald Trump was backing the still-evolving bill. But cracks within the party were on full display and it seemed that pushing the measure through the House next week would be a challenge.

“If it was a resolution on apple pie, you’re going to lose some votes, some Republican votes,” said Rep. Mario Diaz-Balart, R-Fla.

A day after top Republicans said the House would vote next week on two competing immigration measures, it was widely assumed that a hard-right measure would lose. That bill would give young so-called Dreamer immigrants just limited opportunities to remain in the U.S. while imposing tough restrictions on legal immigration and bolstering border security.

GOP leaders, negotiating with quarreling moderates and conservatives, were still writing the second bill. Republicans said it would contain a way for Dreamers to qualify for permanent residence and potentially become citizens, while accepting conservatives’ demands to finance Trump’s proposed border wall with Mexico and restrictions on legal immigration.

With Republicans battling to keep their House majority in November’s elections, merely staging the immigration votes, win or lose, achieves some political objectives. The plan helped party leaders block unhappy moderates trying to force the House to consider immigration bills considered too liberal by many Republicans, and will let lawmakers assert that they tried addressing the issue.

If both bills lose, “at least you know where everyone stands,” said Rep. Warren Davidson, R-Ohio, a member of the House Freedom Caucus.

Democrats seemed likely to solidly oppose both packages. The leader of the Congressional Hispanic Caucus said her group’s goal was to have “zero Democratic support” for the GOP bills. Rep. Michelle Lujan Grisham, D-N.M., said the Republican measures “are going to make it clearer than ever that Dreamers are pawns for a wall. That is going to be a very difficult thing to defend” in the November elections, she said.

The bills represent the GOP’s attempt to address Dreamers, young immigrants brought to the U.S. illegally as children. Trump last year terminated the Deferred Action for Childhood Arrivals program, or DACA, which has temporarily shielded hundreds of thousands of them from deportation. Federal courts have kept the program functioning for now.

Even if the compromise measure passed the House, its fate in the Senate was in doubt. Democrats there have enough votes to scuttle any bill.

Trump’s backing, especially if he announced it publicly, could help nail down some support. But GOP “no” votes seemed likely, including by some conservatives dubious about granting what they consider amnesty to people in the U.S. illegally.