Japan’s imports continued to surge, driven by soaring energy prices and a weaker yen, extending a sequence of trade deficits to an eighth-straight month as export gains slowed.

Imports jumped 31.2% from a year ago on higher oil, coal and gas prices, compared with a 28.9% rise forecast by analysts. A stronger expansion of chipmaking shipments supported continued gains in exports, but a fall in auto shipments dragged on the pace of gains.

While the trade deficit narrowed to ¥412.4 billion ($3.2 billion), the streak of shortfalls is the longest since early 2015, providing another possible reason for yen selling as Japan’s currency continues to slide against the dollar.