creek

Next.js

Deploy Next.js apps to Creek — static export or full SSR.

Quick Start

npx create-next-app my-app
cd my-app
npm install @solcreek/adapter-creek
npx creek deploy

Creek auto-detects Next.js >= 16.2.3, invokes the adapter, and deploys. No configuration needed.

Static Export

For pure static sites, add output: "export" to your Next.js config:

next.config.ts
const nextConfig = {
  output: "export",
};
export default nextConfig;

Creek deploys the out/ directory as a static site. Do not set framework = "nextjs" in creek.toml for static export — Creek treats it as a standard static site, which is correct.

SSR (Server-Side Rendering)

Install the adapter and deploy:

npm install @solcreek/adapter-creek
npx creek deploy

That's it. The CLI detects Next.js >= 16.2.3 + the adapter package, then:

  1. Runs next build --webpack with the adapter's NEXT_ADAPTER_PATH
  2. The adapter's onBuildComplete hook bundles the worker output
  3. CLI uploads .creek/adapter-output/ (worker + static assets)

creek.toml (optional)

creek.toml
[project]
name = "my-nextjs-app"
framework = "nextjs"

Setting framework = "nextjs" is optional — the CLI auto-detects from package.json. Useful when you want to pin the project name.

What the adapter handles

  • Streaming SSR via TransformStream — no node:http server dependency
  • Embedded manifests — route, build, and prerender manifests inlined into the bundle via a custom fs shim
  • Node.js API shimshttp, https, net, inspector, fs, vm, process EventEmitter stubs
  • Turbopack runtime patching — dynamic chunk loading replaced with static requireChunk() switch

Monorepo Setup

In a pnpm/npm/yarn monorepo, Next.js 16+ requires turbopack.root:

next.config.ts
import { resolve } from "node:path";

const nextConfig = {
  turbopack: {
    root: resolve(process.cwd(), "../.."),
  },
};
export default nextConfig;

Known Limitations

  • Requires Next.js >= 16.2.3 — older versions fall back to a legacy build path
  • --webpack flag is mandatory — Turbopack's chunked output format can't be bundled by esbuild (the adapter sets this automatically)
  • ISR / on-demand revalidation — cache handler is in-memory only; Durable Object-backed cache is planned
  • Image Optimization — use unoptimized: true or a custom loader; sharp is shimmed to no-op (falls back to resvg.wasm for @vercel/og)
  • Bundle size — large Next.js apps produce 5-7MB workers; within Workers limits but worth monitoring

On this page