London CNN Business  — 

Aston Martin shares tanked nearly 20% in London after the UK carmaker revealed that rising costs had wiped out its profits for 2018.

The company on Thursday posted an annual loss of £68 million ($90 million) after being profitable in 2017. The loss was entirely due to costs of £136 million ($181 million) related to its October IPO.

The favorite automaker of fictional British secret service agent James Bond, Aston Martin has struggled to overcome doubts about its ability to compete with rivals including Ferrari (RACE).

Shares in the company dropped 5% on their first day of trading last year, and even a 25% increase in revenue in 2018 couldn’t stop investors from dumping the stock on Thursday. It has now plunged over 40% since its debut.

Aston sold 6,441 cars last year, according to its earnings statement. CEO Andy Palmer said he expects that figure to grow once the company completes a new factory in Wales and begins selling its DBX SUV. The company expects to begin trial production of the DBX in the second quarter of this year, with full production commencing in the first half of 2020.

But the luxury carmaker also acknowledged that it could be in trouble if Britain leaves the European Union without a Brexit deal that protects trade.

Aston warned Thursday that production could be disrupted. It has set aside £30 million ($40 million) to deal with the potential impact of a disorderly exit.

It said it had recruited a chief purchasing and supply chain officer to prepare for Brexit, and put in place contingency plans to use different routes and ports to deliver parts.

The United Kingdom is set to leave the European Union in just 29 days, but the political situation remains highly uncertain.

Crashing out of the European Union would result in new costs and trade barriers for companies in Britain. Snarled supply chains would put manufacturing companies in an especially difficult position.

Carmakers are already canceling planned investments, and preparing to idle factories. Global companies including BMW, Nissan (NSANF) and Ford (F) each have plants in the United Kingdom.

Correction: An earlier version of this article contained an incorrect conversion of the £30 million Aston Martin set aside.