Chinese and Japanese workers in the US were the victims of both racism and nativism because they were seen as both members of another race and another culture. Nativism was the same obstacle that the Irish and the Italians and every other immigrant faced, but racism could not have existed without the model of race that developed to rationalize the African slave trade in the 17th century. While extreme nativists believed only northern and western Europeans had the cultural background to become good Americans, most people knew the children of "white" immigrants would be no different than other Americans.
But the racial model meant non-European immigrants were seen as fundamentally different, and therefore inferior. Racial prejudice and nativist prejudice worked together: racists said the Chinese could not fit in; nativists said the Chinese should stay in their own country.