Chancellor Philip Hammond has signalled he would be prepared to vote against a no-deal Brexit in Parliament, claiming it could cost the UK up to £90bn.
Leaving the EU without a legal agreement would be the "wrong" policy and cause a huge "hit" to the public finances, he told MPs.
He said it was "highly unlikely" he would still be in his job after Theresa May stands down next month.
But he said it would be up to MPs to ensure no-deal "doesn't happen".
Shadow chancellor John McDonnell asked Mr Hammond at Treasury questions if he would join Labour in voting against no deal and opposing any attempt by a new prime minister to stop Parliament sitting in order to let a no-deal Brexit go ahead.
Meanwhile, the United Kingdom Warehousing Association has told BBC Newsnight that UK warehouses are "full", raising doubts about the ability of UK firms to stockpile goods ahead of a potential no-deal Brexit on 31 October.
Boris Johnson and Jeremy Hunt, the two men vying to succeed Mrs May, have both said they would be willing to take the UK out of the EU without a deal.
Mr Johnson has refused to rule out shutting down - proroguing - Parliament to push it through.
In reply to Mr McDonnell, the chancellor said: "I do agree with him, it would be wrong for a British government to pursue no deal as a policy and I believe it will be for the House of Commons, of which I will continue proudly to be a member, to ensure that doesn't happen."
In the event of no deal, the UK would immediately leave the EU with no agreement about the "divorce" process and leave both the single market and customs union - arrangements designed to help trade between members by eliminating checks and tariffs (taxes on imports).
What could happen in the event of no deal?
- Tariffs - taxes on imports - are likely to be applied to most UK goods exported to the continent, making them less competitive and increasing costs to businesses.
- UK exporters could also face non-tariff barriers, such as additional customs declarations, rules of origin checks and sanitary inspections
- Border checks could cause bottlenecks at British ports, such as Dover
- This could potentially lead to disruption to food and medical supplies, although the NHS and retailers have been stockpiling
- Prices of some food items could rise unless the UK chose to apply zero tariffs on EU food imports
- The services sector would lose its guaranteed access to the EU single market, affecting everything from banking and insurance to lawyers, musicians and chefs
- Mobile phone roaming charges could return - although some operators have already ruled this out
The chancellor has been a long-term critic of a no-deal exit, making him something of a bogeyman among Brexiteers within his own party.
In recent days, Mr Hammond has questioned both leadership candidates' promises of greater spending and tax cuts if they make it to Downing Street.
He has insisted there is "no pot of money" sitting in the Treasury for extra spending or tax cuts and, in the event of a no-deal exit, all the £26bn "headroom" in the public finances would be absorbed by dealing with the economic upheaval.
"I have no doubt whatsoever that in a no deal exit we will need all of that money, and more, to respond to the immediate impacts of the disruption of a no deal exit," he told MPs.
"And that will mean there is no money available for either tax cuts or spending increases."
"But let me go further - the government's analysis suggests that in a disruptive no-deal exit there will be a hit to the Exchequer of about £90bn. That will also have to be factored in to future spending and tax decisions."
The Treasury has previously said a no-deal exit could lead to a £80bn spike in borrowing.
Speaking after Treasury questions, Mr McDonnell told reporters he felt the chancellor had been "ferocious" in his criticism of no deal and would be "influential" on the matter from the backbenches - if indeed that was where he found himself under a new Tory leader.
John McDonnell predicts an election in autumn - says “instability of Boris Johnson in all aspects of his life...and in his political decision making is one of deepest worries we all must have.”— Vicki Young (@BBCVickiYoung) July 2, 2019
He said there was a "solid block" of Conservative MPs who would join Labour and other opposition parties in opposing a no-deal outcome.
Asked how Labour would prevent a no-deal Brexit, Mr McDonnell said the "window of opportunity was short" but the moral authority of Parliament would be in question if MPs repeatedly voted against it and yet the new prime minister went ahead anyway.
Meanwhile, the leadership contenders have been taking part in a hustings in Belfast where they were asked about their attitudes to no deal and their plans to solve the so-far intractable issue of the Irish border.
BBC assistant political editor Norman Smith said the difference between them was largely tonal - Mr Hunt has a tone of regret rather than enthusiasm when it comes to the prospect of no deal, while Mr Johnson seems almost keen to get to that point and the huge opportunities he sees in its aftermath.
Our correspondent also said the feeling in Team Johnson is that the desire among Tory MPs to fight a no deal may be fading.