China considers democratic Taiwan to be a wayward province and has never renounced the use of force to bring the island under its control.
The United States has no formal ties with Taiwan but is bound by law to help it defend itself and is the island's main source of arms.
The National Defense Authorization Act, passed by the House, also proposes expanding training and exercises with Taiwan.
Chinese foreign ministry spokesman Lu Kang said "negative content" related to Taiwan went seriously against the "one China" principle and was an interference in China's internal affairs.
"China has already lodged stern representations with the United States about this," Lu said.
China resolutely opposes any form of official contacts between the US and Taiwan militaries, he said.
"We urge the United States to fully recognize the serious harmfulness of the relevant clauses in the act, and should not allow them into law, and not turn back the wheel of history to avoid damaging the broad picture of Sino-US cooperation."
China regularly calls Taiwan the most sensitive and important issue between it and the United States.
China urged the US last month to revoke its "wrong decision" to sell Taiwan US$1.42 billion (HK$11.08 billion) worth of arms, saying it contradicted a "consensus" President Xi Jinping reached with his counterpart, Donald Trump, in talks in April in Florida.
Beijing's ties with Taiwan has been frosty since President Tsai Ing-wen won election on the island by a landslide last year.
China suspects Tsai, who leads the independence-leaning Democratic Progressive Party, wants to declare the island's formal independence, a red line for Beijing.