HMRC has said it needs an extra £7.3m to upgrade customs technology in order to prevent huge tailbacks and piles of rotting food at UK ports from 2019.
MPs said if a new system - due to be introduced two months before Brexit - went wrong, it would be "catastrophic".
HMRC chief executive Jon Thompson told Parliament's public accounts committee he was confident the system would be ready in January 2019.
But the back-up plan was not yet fully-funded, he said.
Mr Thompson also told the committee that HMRC would need up to £450m in extra funding and 3,000-5,000 extra staff to deal with Brexit if the UK left the EU with no deal - the "most extreme version" of leaving the EU.
HMRC has already been given £78m from the £250m government funding set aside this year to plan for that outcome.
Most is being spent on dealing with customs, but it has also been used to plan for the impact no deal would have on indirect taxes, the welfare state and data sharing, he told MPs.
Asking Mr Thompson about the change in computer systems, Labour MP Shabana Mahmood said: "If this goes wrong it will be catastrophic for Britain's global reputation.
"We would have queues at the ports of Dover, we would have rotting food."
Meg Hillier, also from Labour, said: "The queues [could be] 180km (111 miles) if there is a delay at the port of Dover. It could be catastrophic."
A 180km queue would potentially stretch from Dover back beyond London.
Mr Thompson said HMRC was talking to the Treasury about the extra £7.3m to make sure the old system could cope with extra work generated by Brexit.
The move to the updated Customs Declaration Service (CDC) from the CHIEF system was planned before the UK voted to leave the EU.
Its completion date was later brought forward to January 2019.
As a member of the EU customs union, the UK does not impose taxes or require customs declarations on goods from other member states.
As part of the Brexit process, the government plans to negotiate new customs arrangements and leave the EU customs union.