Output directory not found Cloudflare Origin: Edge & web server Last updated 13 Oct 2026

Cloudflare Pages build: Error: Output directory "dist" not found / Failed: build output directory not found

The Pages build finished, but the folder set as “Build output directory” doesn’t exist — the framework wrote its files somewhere else, or the build command didn’t run.

Exact message you may see Output directory not foundFailed: build output directory not foundError: Output directory "dist" not foundFailed: build output directory
Seen on: Cloudflare

Meaning

Each framework outputs to a different folder (Vite dist, Next.js static export out, Astro dist, Hugo public, CRA build). A wrong root directory (monorepo), a missing build command, or a build that silently skipped output all cause this.

Common causes

  • Output directory setting doesn’t match the framework
  • Build command empty or wrong (nothing built)
  • Monorepo: root directory not set to the app folder
  • Next.js without static export (output: 'export')

⚡ Quick fix

  1. Set the correct output directory for your framework
  2. Set root directory for monorepos
  3. Run the build locally and see which folder appears

Detailed fix by platform

Shell

  1. npm run build && ls -d dist build out public 2>/dev/null

JavaScript

  1. javascript
    // next.config.js for static Pages deployments
    module.exports = { output: 'export' };   // writes to out/

How to diagnose

  1. Settings — Build command, output dir, root dir
  2. Local — Folder produced by npm run build

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Edge & web server. Errors that are often confused with or caused by this one (click to open):

1104 — Cloudflare Error 1104: A variation of this script was not found (Worker route to deleted script) (Cloudflare)1104COPY failed — COPY failed: file not found in build context / "/app/x": not found (Docker)COPY faileddid not complete successfully — failed to solve: process "/bin/sh -c ..." did not complete successfully: exit code: 1 (Docker)did not complete succ…ELIFECYCLE — npm ERR! code ELIFECYCLE / Command failed with exit code 1 (npm)ELIFECYCLEENOENT — npm ERR! enoent ENOENT: no such file or directory, open '/path/package.json' (npm)ENOENTEnvironment health has transitioned to Severe — Elastic Beanstalk: Environment health has transitioned from Ok to Severe (AWS)Environment health ha…ERR_OSSL_EVP_UNSUPPORTED — Error: error:0308010C:digital envelope routines::unsupported (Node.js)ERR_OSSL_EVP_UNSUPPOR…Failed building wheel — error: subprocess-exited-with-error / Failed building wheel for x (Python)Failed building wheelOutput di…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.