Skip to content
>_VibeUnstuck

No Output Directory named "dist" found

Last verified:

The fix

No Output Directory named "dist" found after the Build completed. Vercel looked for a folder the build did not write. Set the framework preset to the app you actually build, or point Output Directory at the folder that exists.

  1. 1

    Read the folder name in the error, then see what the build wrote

    Run the same build command locally. Vite leaves dist/index.html. Next.js leaves .next and is deployed as a Next.js app, not as dist. If the local build writes nothing, the script is not building the site. Change the script before changing Vercel.

  2. 2

    Match the framework preset to the app

    Vite, including a Lovable or Bolt export, uses the Vite preset, build command npm run build or vite build, and output dist. Next.js uses the Next.js preset and no static Output Directory. Do not set a Next.js project's output to dist or public. In a monorepo, set Root Directory to the folder that contains the app's package.json.

  3. 3

    Remove a stale override

    Delete outputDirectory from vercel.json unless it is the folder you just watched the build create. Remove a legacy builds list that points at public or build for a Vite app. The framework preset lives in the project settings. Set that to Vite or Next.js. A framework value in vercel.json is the same switch. Settings in the dashboard override the repo until you clear them. Redeploy after the change. Do not commit dist.

  4. 4

    After the folder is found, fix refresh separately

    A Vite app on Vercel still needs a rewrite to index.html for client routes, or a reload of /dashboard is a 404. That is the next page. Do not add that rewrite to make this missing-folder error go away. There is no index.html until the output directory exists.

Why it happens

Vercel runs the build, then publishes one folder. The log says Error: No Output Directory named "dist" found after the Build completed. You can configure the Output Directory in your Project Settings. The quoted name is whatever the project settings or vercel.json asked for. Vite writes dist. Create React App writes build. A preset of Other often looks for public. Next.js on Vercel does not use that static folder. The Next builder publishes its own output.

The build can succeed and this line still fails. npm run build ran tsc and never vite build, or it wrote dist in a subfolder while Vercel looked at the repository root. A Lovable or Bolt export is a Vite app. Importing it as Next.js, or as Other with Output Directory public, looks for a folder the Vite build did not create. A vercel.json outputDirectory overrides the preset. An old builds entry with distDir does too.

A site that deploys and then 404s on refresh of /dashboard got past this error. That is the client-route fallback. A white screen after a successful publish is the blank-page error, not a missing folder.

The next error you'll probably hit

Once this is fixed, the usual follow-up is 404 on refresh of a client route. A 404 on refresh means the Vite app works from /, then a reload of /dashboard misses index.html. Rewrite unknown paths to index.html on the host.

Prompt to paste back into your AI tool

Paste this above the error.

Vercel failed with: No Output Directory named "<dist, public, or build>" found after the Build completed. The framework in package.json is <vite or next>. The build script is <script>. Root directory of the app is <path>.

Do not commit the dist folder. Do not set a Next.js app's Output Directory to dist. Do not add a rewrite to index.html until a build actually writes index.html.

1. Say which folder the build command creates locally. If it creates none, fix the script so the real build runs.
2. Set the Vercel framework preset to that tool. For Vite, output is dist. For Next.js, do not set a static output directory.
3. Remove outputDirectory or a legacy builds entry that names a different folder.
4. If this is a monorepo, set Root Directory to the package that contains package.json. Do not edit application components.

Common questions

+The log shows vite build wrote dist/index.html, then says No Output Directory named "dist" found. Why?

Vercel is looking in a different directory than the one Vite wrote. Root Directory is the repository root while the app lives in a subfolder, or an override names another folder. Point Root Directory at the app and keep the output as dist.

+This is a Next.js app and the error names public. What do I change?

The preset is Other, or Output Directory is public. Switch the preset to Next.js and clear the static output directory. Next does not publish a public folder as the site.

Related errors