Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Next.js and React

Vercel says No Output Directory named dist was found after my Nuxt build

ErrorError: 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.

  • Applies to Nuxt 3, Nuxt 4, Vercel
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 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.json
  2. 2Match what you see, then jump to its fix

    1. 1Output Directory shows dist with the Override switch on, or vercel.json has outputDirectory setAn Output Directory override says distFix
    2. 2Framework Preset shows Other and the Build Command override is onThe framework preset is Other, so Nuxt is not detectedFix
    3. 3The build log has no Nuxt output at all, or ends instantlyThe build step is skipped or builds the wrong thingFix

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.json

2Fix

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 --prod

Confirmed by vercel.com

Did this fix it?

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.json

2Fix

Select Nuxt as the Framework Preset in Project Settings, and let Vercel configure the build and output.

# Project Settings -> Build and Deployment -> Framework Preset: Nuxt

3Verify

Redeploy and confirm the build log shows a Nuxt build.

npx vercel --prod

Confirmed by vercel.com

Did this fix it?

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.json

2Fix

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 build

Confirmed by vercel.com

Did this fix it?

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 fix

Web 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

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.