Exports from Japan have plummeted since last December, dropping more than 5 percent in September alone.

Much of that pain has come from China. The country is a major purchaser of Japanese machinery and components, which it uses to assemble finished goods to sell to the rest of the world.

But demand for Chinese-made products has fallen as tariffs from President Trump’s trade war bite. That means a smaller market for Japan’s industrial goods, and also fewer Chinese consumers buying popular Japanese products like cars, a trend that has been reflected in weak corporate earnings for Japanese companies over the past year.

The uncertainty caused by the United States-China trade conflict has also strengthened the yen against the dollar, making matters even worse for beleaguered Japanese firms, which have seen their profits shrink and the prices of their goods and services increase abroad.

Adding to the pain, a large number of South Korean consumers have boycotted Japan’s economy after Tokyo tightened controls on a wide array of exports to the country, citing national security concerns. The move — which Seoul says was driven by disputes over the legacy of Japan’s imperial past — inflamed public anger in South Korea and drove consumers to forswear Japanese luxuries from beer to spa vacations.

Despite all that, Japan’s economy has continued to defy concerns that it could teeter into recession. So far, it has managed to fend off threats from the Trump administration to slap potentially devastating tariffs on its auto industry, and even struck a mini-deal with the president on trade that — if approved by Japan’s Parliament — could add to its bottom line.

At home, relatively strong domestic consumption and business investment have buoyed growth.

Consumers rushed to purchase big-ticket items — a phenomenon known as front-loading — ahead of an October tax increase on most goods and services from 8 percent to 10 percent.