vercel/next.js · error

"next start" does not work with "output: export" configurati

Error message

"next start" does not work with "output: export" configuration. Use "npx serve@latest out" instead.

What it means

Thrown by NextServer.getServer() during startup when next.config.js has output: 'export' and the server is not in dev mode. An exported build produces only static HTML/JS/CSS in the `out` directory and has no Node server runtime, so `next start` cannot serve it.

Source

Thrown at packages/next/src/server/next.ts:388

        // from next.config.js
      }
    }

    return config
  }

  private async getServer() {
    if (!this.serverPromise) {
      this.serverPromise = this[SYMBOL_LOAD_CONFIG]().then(async (conf) => {
        if (!this.options.dev) {
          if (conf.output === 'standalone') {
            if (!process.env.__NEXT_PRIVATE_STANDALONE_CONFIG) {
              log.warn(
                `"next start" does not work with "output: standalone" configuration. Use "node .next/standalone/server.js" instead.`
              )
            }
          } else if (conf.output === 'export') {
            throw new Error(
              `"next start" does not work with "output: export" configuration. Use "npx serve@latest out" instead.`
            )
          }
        }

        this.server = await this.createServer({
          ...this.options,
          conf,
        })
        if (this.preparedAssetPrefix) {
          this.server.setAssetPrefix(this.preparedAssetPrefix)
        }
        return this.server
      })
    }
    return this.serverPromise
  }

View on GitHub (pinned to 0ae8c72462)

Solutions

  1. Serve the static `out` directory with a static file server: `npx serve@latest out`.
  2. Deploy the `out` folder to a static host (Vercel, Netlify, GitHub Pages, S3+CloudFront, Nginx).
  3. If you actually need a Node server runtime, remove `output: 'export'` from next.config.js.

Example fix

// before (next.config.js)
module.exports = { output: 'export' }
# then: next start  // fails
// after
module.exports = { output: 'export' }
# then: next build && npx serve@latest out
Defensive patterns

Strategy: validation

Validate before calling

// Before starting, branch on output mode.
const cfg = require('./next.config.js')
if (cfg.output === 'export') {
  console.log('output:export -> serving static out/ with a static server')
  // spawn `npx serve@latest out` instead of next start
}

Prevention

When it happens

Trigger: Configuring `output: 'export'` in next.config.js and then running `next start`. getServer() checks `if (!this.options.dev) { ... else if (conf.output === 'export') throw }`.

Common situations: Switching a project to static export but keeping the `next start` script in package.json; CI pipeline that always runs build+start regardless of output mode.

Related errors


AI-assisted analysis of vercel/next.js@0ae8c72462 (2026-08-06). Data as JSON: /api/errors/b984985b36ab9655. Report an issue: GitHub.