Alvarez grounded out to first base in the first inning and was replaced at DH by Corey Julks when his turn came up again in the third.
Alvarez said he first felt sore when hitting in the cage before the game and felt pain again when he swung and missed at the first two pitches in his lone at bat.
"We'll evaluate him tomorrow," manager Dusty Baker said. "That's a tough blow right there. We've just got to regroup and try to figure out how we're going to win some ballgames and get through this."
Alvarez came in batting .274 with 17 home runs and 55 RBIs in 56 games.
The AL Rookie of the Year in 2019, Alvarez was an All-Star for the first time last season, when he hit .206 with a career-high 37 home runs and 97 RBIs.
The Associated Press contributed to this report.