Conservative leader Andrew Scheer and Liberal leader Justin Trudeau gesture at the Federal Leaders Debate in Gatineau, Quebec on October 7, 2019. Sean Kilpatrick | AFP | Getty Images

No matter who takes the top job in Canada at the next elections, the new government will likely have to take a harder line on China, analysts say. "Whoever is elected will have to take a tougher stance. Public opinion (in Canada) has shifted significantly against China's favor," said Lynette Ong, associate professor at the University of Toronto's department of political science and Asian institute.

Voting day on Oct. 21

Canadians head to the polls on October 21 to elect a new federal government. Opposition leader Andrew Scheer of the Conservative Party and incumbent Prime Minister Justin Trudeau, who leads the Liberal party, are neck-and-neck in the polls.

There is no question that Washington is putting very heavy pressure on Ottawa to ban Huawei in our 5G system. Paul Evans The University of British Columbia

Canada has been caught between its two largest trading partners as the U.S. and China remain locked in a trade war that's lasted more than a year. "Under the Trudeau government, Canada has been trying not to pick sides, even though Canada and the US are close allies, in military and economic terms. Canada sees China as a growing power that it needs to engage, which makes it hard to navigate the current imbroglio," Ong told CNBC via email. "The US-China trade war makes things more difficult for Canadian policy makers," said Robert Fay, director of global economy at the Centre for International Governance Innovation in Canada. "It's not about 'picking sides' – rather it is about making sure that Canadian businesses have access to many markets for their products and services," Fay told CNBC in an email.

Relations with the US

The U.S. is Canada's top trading partner, with goods and services trade between the two countries totaling an estimated $714.1 billion in 2018, according to the U.S. Trade Representative office. Canada was America's third largest supplier of goods imports last year, the USTR said. Trump's protectionist stance on trade has hit countries in Europe as well as Mexico, Japan and China. Canada has not been spared either. Citing national security concerns, the Trump administration raised steel and aluminium tariffs on Canada last summer. The U.S. eventually lifted those tariffs, paving the way for the United States Mexico Canada Agreement — an updated version of the the 25-year-old NAFTA deal. Still, their bilateral trade ties remain contentious.

"The USMCA is yet to be ratified in the U.S., and therefore the U.S. has considerable leverage, making Canada very vulnerable right now," said Paul Evans, professor at the public policy and global affairs school at the University of British Columbia in Vancouver, Canada. The neighboring allies have seen bilateral ties frat since President Donald Trump took office in 2017. For one, the U.S. withdrew from the Paris Climate Accord which Canada has been a loud advocate for. Then Trump openly called Trudeau "very dishonest and weak" at a G-7 meeting in Quebec in June last year.

Relations with China

China may be Canada's second largest trade partner, but it accounts for a much smaller percentage of the North American country's exports compared to the U.S. According to Statistics Canada, trade between Canada and China was $37.9 billion in 2018, and exports from Canada to China was $25.3 billion — making up only 4.6% of Canadian total exports. Relations between Canada and China took a turn for the worse in December last year with the arrest of Chinese tech giant Huawei's CFO Meng Wanzhou, who is also the daughter of the company's founder. Meng was detained in Vancouver at the request of the U.S. Subsequently, Washington banned Huawei from participating in the development of 5G technology within its borders and has urged its allies to do the same.

If the Hong Kong situation deteriorates ... then Canada will have to take a harder stance on China because there are 300,000 Canadian citizens living in Hong Kong. Paul Evans professor at the University of British Columbia

The U.S has alleged that Huawei's technology could enable Chinese espionage but the tech giant has repeatedly denied that its products represent any risk. "There is no question that Washington is putting very heavy pressure on Ottawa to ban Huawei in our 5G system," said Evans. "Many Canadians have felt that the U.S. has thrown Canada under the 'anti-china, cold war' bus with the Meng (Wanzhou) arrest," said Evans. "It is a widespread view among tech experts in Canada" that Huawei's 3G and 4G technology worked well in Canada, he added.

Canada is caught between a rock and a hard place. If Canada were to follow the U.S. in banning Chinese tech, it will "put a chill in the bilateral relationship with China," Evans said. Yet if it doesn't, Canada may face "retaliation from the U.S. and that would be hard to juggle," he added. Eurasia Group said Friday that the U.S. bill passed, which commended Canada for its support in detaining Meng, foreshadows "another year of strained relations with Canada." "As the trial proceeds next year, the China-Canada relationship is unlikely to improve from its current chilly state," wrote Kelsey Broderick, analyst at the political consultancy firm. Following Meng's arrest, Beijing detained other Canadian citizens for alleged spying and blocked imports of some of the country's most traded commodities — canola and meat.

Hong Kong protests