Chicago, home to the nation’s busiest airport, sounded alarm bells last month when a woman contracted the virus after traveling in China and passed it to her spouse, the first person-to-person transmission in the United States. Even after the couple recovered and were discharged from a suburban hospital, signs of worry throughout the city have remained: Travelers at O’Hare International Airport seemed to be wearing more face masks than usual, and in Chinatown, on the city’s South Side, businesses have posted signs forbidding people who have recently visited China to step through the door. (Some Chicagoans have grimly noted on Twitter that an HBO adaptation of “Station Eleven,” a 2014 post-apocalyptic novel about a world ravaged by a global flu pandemic, is currently being filmed around the city.)

In San Francisco, recent immigrants from China said they were worrying about the very real health threats facing loved ones who are still there, while encountering the fears of others in their own daily lives in the United States. Yihao Xie, an environmental researcher at a San Francisco-based nonprofit organization, traveled back to the United States from Lanzhou, China, his hometown, early on Jan. 30 — narrowly beating the shutdown of airline travel.

Although Lanzhou is far from Wuhan, the center of the outbreak, his co-workers in the United States thought it best for him to stay home from the office for 14 days. He said he understood.

Since then, he took a walk in a nature preserve near his house to calm himself. At the grocery store, he said he felt the eyes of strangers appraising him.

“A few folks were giving me looks,” he said. “I don’t think they were malicious or hostile, but ‘Why are you wearing a mask — are you sick?’”

Robert Li, a resident of San Francisco, was browsing phones at a computer store last week when he overheard an employee talking with a customer about the outbreak. “‘Of course, if you eat raw bats, you’re going to get coronavirus,’” he recalled hearing the worker saying.

“They were basically making fun of Asians,” said Mr. Li, who is ethnically Chinese. “This is part of a racial trope that Chinese people eat everything.”