Vercel says No Output Directory named dist was found after my Nuxt build
Error: No Output Directory named "dist" found after the Build completed.Short answer
Vercel looks for the build in the Output Directory configured for the project. For Nuxt it normally sets this itself. The error means an override or a wrong preset points at dist, or the build step never ran. Remove the override and set the preset to Nuxt.
Fix it fast
1Find out which cause you have
Open Project Settings, Build and Deployment, and read three fields: Framework Preset, Build Command and Output Directory. A value in Output Directory with Override on is the usual culprit.
cat vercel.json2Match what you see, then jump to its fix
- 1
Output Directory shows dist with the Override switch on, or vercel.json has outputDirectory setAn Output Directory override says distFix - 2
Framework Preset shows Other and the Build Command override is onThe framework preset is Other, so Nuxt is not detectedFix - 3
The build log has no Nuxt output at all, or ends instantlyThe build step is skipped or builds the wrong thingFix
- 1
What does the error look like?
Error: No Output Directory named "dist" found after the Build completed.
Cause 1 of 3
An Output Directory override says dist
1Check
If Vercel detects a framework, it configures the output directory itself. An override replaces that detected value, so a dist folder that your build does not produce fails the check.
grep -n outputDirectory vercel.json2Fix
Turn the Override off in Project Settings and remove outputDirectory from vercel.json.
# vercel.json: delete this line
"outputDirectory": "dist"3Verify
Redeploy. The build finishes without the dist error.
npx vercel --prodConfirmed by vercel.com
Cause 2 of 3
The framework preset is Other, so Nuxt is not detected
1Check
When no framework is detected, Other is selected and the build command has to be entered manually.
grep -n '"nuxt"' package.json
grep -n '"framework"' vercel.json2Fix
Select Nuxt as the Framework Preset in Project Settings, and let Vercel configure the build and output.
# Project Settings -> Build and Deployment -> Framework Preset: Nuxt3Verify
Redeploy and confirm the build log shows a Nuxt build.
npx vercel --prodConfirmed by vercel.com
Cause 3 of 3
The build step is skipped or builds the wrong thing
1Check
Leaving the Build Command override empty on a project set to Other skips the build step. The Nuxt docs give nuxt build as the default build command and nuxt generate for fully static sites.
grep -n '"build"' package.json2Fix
Put a real build script in package.json and clear any empty override.
"scripts": {
"build": "nuxt build"
}3Verify
Run the build locally, then redeploy.
npm run buildConfirmed by vercel.com
How do I stop it coming back?
- Leave Framework Preset, Build Command and Output Directory on their detected values.
- Do not copy build settings from an old host without checking what your Nuxt version writes.
- Keep any override in vercel.json so it is reviewed with the code.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Related fixes
Web apps
tsconfig rejects allowImportingTsExtensions
An error that allowImportingTsExtensions needs noEmit or emitDeclarationOnly
allowImportingTsExtensions lets files import each other with .ts or .tsx extensions, and TypeScript only allows it together with noEmit or emitDeclarationOnly.
2 causes, each with a fixWeb apps
AuthUserPoolException: Auth UserPool not configured in a Next.js app
Auth UserPool not configured
The error means an Amplify Auth call ran before Amplify.configure did.
3 causes, each with a fixWeb apps
Module not found for antd/dist/antd.less after upgrading to Ant Design 5
Module not found: Error: Can't resolve 'antd/dist/antd.less'
Ant Design 5 dropped Less and the bundled CSS file for CSS-in-JS, so antd/dist/antd.less no longer exists.
3 causes, each with a fixWeb apps
Apollo Server rejects a request as a potential CSRF
HTTP 400 Bad Request from the GraphQL endpoint
Apollo Server's CSRF prevention is on by default.
3 causes, each with a fixWeb apps
Apollo Client is blocked by CORS when the GraphQL server runs on AWS Lambda
No 'Access-Control-Allow-Origin' header is present on the requested resource.
Apollo Server does not set CORS for you when it runs behind a framework or integration, and on Lambda that layer is API Gateway.
5 causes, each with a fixWeb apps
A POST to a Google Apps Script web app returns 405 or a CORS error
Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Apps Script web apps run doPost for POST and doGet for GET, and the Apps Script guides describe no other entry points.
3 causes, each with a fix