Skip to content

Conversation

@vicb
Copy link
Contributor

@vicb vicb commented Oct 23, 2025

Can be tested with

// next.config.ts
import type { NextConfig } from "next";

const nextConfig: NextConfig = {
  experimental: {
    adapterPath: "/path/to/app/node_modules/@opennextjs/cloudflare/dist/cli/adapter.js"
  }
};

export default nextConfig;
// open-next.config.ts
const config = {
  default: {
    minify: false,
    override: {
				wrapper: "cloudflare-node",
				converter: "edge",
				proxyExternalRequest: "fetch",
				incrementalCache: "dummy",
				tagCache: "dummy",
				queue: "dummy",
				cdnInvalidation: "dummy",
    },
  },

  dangerous: {
    middlewareHeadersOverrideNextConfigHeaders: true,
    useAdapterOutputs: true,
  },

		middleware: {
			external: true,
			override: {
				wrapper: "cloudflare-edge",
				converter: "edge",
				proxyExternalRequest: "fetch",
				incrementalCache: "dummy",
				tagCache: "dummy",
				queue: "dummy",
			},
			assetResolver: () => null,
		},
};

export default config;
// wrangler.jsonc
{
	"$schema": "node_modules/wrangler/config-schema.json",
	"main": ".open-next/worker.js",
	"name": "create-next-app",
	"compatibility_date": "2025-10-01",
	"compatibility_flags": ["nodejs_compat", "global_fetch_strictly_public"],
	"assets": {
		"directory": ".open-next/assets",
		"binding": "ASSETS"
	}
}

You can then pnpm build and pnpm wrangler dev

Note that pnpm build should point to next build --webpack (turbopack is now the default but not supported yet)

@changeset-bot
Copy link

changeset-bot bot commented Oct 23, 2025

⚠️ No Changeset found

Latest commit: fa79087

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 23, 2025

Open in StackBlitz

npm i https://pkg.pr.new/@opennextjs/cloudflare@961

commit: fa79087

@vicb vicb changed the base branch from main to adapters-api October 23, 2025 11:54
Copy link

@mhart mhart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tried this out on a (basic) Next.js 16 project and it worked like a charm

@vicb
Copy link
Contributor Author

vicb commented Nov 10, 2025

Oops thank @mhart, I forgot to merge this PR.
We will merge the branch adapters-api back to main when we update the tests

@vicb vicb merged commit 695c414 into adapters-api Nov 10, 2025
6 of 7 checks passed
@vicb vicb deleted the adapter branch November 10, 2025 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants