Back to Engineering Blog
Tutorials7 min read

Deploying a Next.js 14 Static Export

Configuring output: "export", what breaks when you do, and how to tell before you deploy whether your app can be served as static files at all.

Glacro · Published August 20, 2026

Next.js will happily build in a mode Glacro cannot serve. The fix is one config flag, but the interesting part is what that flag turns off — and finding that out locally rather than after a deploy.

Turning on static export

javascript
// next.config.js
module.exports = {
  output: "export",
  images: { unoptimized: true },
};

With output: "export", next build writes a directory of HTML, CSS and JS instead of a server bundle. Set the output directory to out in your project settings and the deploy will pick it up.

What stops working

Server Actions, route handlers under app/api, middleware, per-request server rendering, incremental static regeneration, and the built-in image optimizer all require a running server. In export mode Next.js will either fail the build or silently skip them. The image optimizer is the one that catches people out, which is why unoptimized is set above.

Key Takeaway
Run next build locally before you connect the repo. If it does not produce an out/ directory on your own machine, it will not produce one on ours.

Data fetching still works

Fetching at build time is fine — generateStaticParams and fetch inside a server component both run during the build and bake the result into the output. What you lose is fetching per request. For anything that must be live, call an API from the browser at runtime.

Related Articles

Product Updates

What Glacro Actually Runs, and What It Doesn't

August 26, 2026 · 6 min read
Engineering

We Audited Our Own Product for Invented Numbers

August 15, 2026 · 9 min read