-
Notifications
You must be signed in to change notification settings - Fork 1
Fix for cloudflare e2e test #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
2531e18
ac67513
8b0c499
51a3963
1ac0ade
f1d8dfc
993eede
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,4 +27,6 @@ test-results | |
| .next/ | ||
| .open-next/ | ||
|
|
||
| coverage/ | ||
| coverage/ | ||
|
|
||
| .wrangler/ | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -9,10 +9,10 @@ | |||||
| "start": "next start --port 3003", | ||||||
| "lint": "next lint", | ||||||
| "clean": "rm -rf .turbo node_modules .next .open-next", | ||||||
| "build:worker": "pnpm opennextjs-cloudflare build", | ||||||
| "build:worker:cf": "pnpm opennextjs-cloudflare build", | ||||||
| "preview:worker": "pnpm opennextjs-cloudflare preview", | ||||||
| "preview": "pnpm build:worker && pnpm preview:worker", | ||||||
| "e2e": "playwright test -c e2e/playwright.config.ts", | ||||||
| "e2e:cf": "playwright test -c e2e/playwright.config.ts", | ||||||
| "build:worker-turbopack": "pnpm opennextjs-cloudflare build --openNextConfigPath open-next.turbopack.config.ts", | ||||||
|
||||||
| "build:worker-turbopack": "pnpm opennextjs-cloudflare build --openNextConfigPath open-next.turbopack.config.ts", | |
| "build:worker-turbopack": "pnpm run build:worker:cf -- --openNextConfigPath open-next.turbopack.config.ts", |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -9,10 +9,10 @@ | |||||
| "start": "next start --port 3001", | ||||||
| "lint": "next lint", | ||||||
| "clean": "rm -rf .turbo node_modules .next .open-next", | ||||||
| "build:worker": "pnpm opennextjs-cloudflare build", | ||||||
| "build:worker:cf": "pnpm opennextjs-cloudflare build", | ||||||
| "preview:worker": "pnpm opennextjs-cloudflare preview", | ||||||
| "preview": "pnpm build:worker && pnpm preview:worker", | ||||||
|
||||||
| "preview": "pnpm build:worker && pnpm preview:worker", | |
| "preview": "pnpm build:worker:cf && pnpm preview:worker", |
Copilot
AI
Feb 14, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build:worker-turbopack script references build:worker which no longer exists. This should reference build:worker:cf instead to work correctly.
| "build:worker-turbopack": "pnpm build:worker --openNextConfigPath open-next.turbopack.config.ts", | |
| "build:worker-turbopack": "pnpm build:worker:cf --openNextConfigPath open-next.turbopack.config.ts", |
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -4,5 +4,6 @@ import memoryQueue from "@opennextjs/cloudflare/overrides/queue/memory-queue"; | |||
|
|
||||
| export default defineCloudflareConfig({ | ||||
| incrementalCache: r2IncrementalCache, | ||||
| enableCacheInterception: true, | ||||
|
||||
| enableCacheInterception: true, |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -9,10 +9,10 @@ | |||||
| "start": "next start --port 3002", | ||||||
| "lint": "next lint", | ||||||
| "clean": "rm -rf .turbo node_modules .next .open-next", | ||||||
| "build:worker": "pnpm opennextjs-cloudflare build", | ||||||
| "build:worker:cf": "pnpm opennextjs-cloudflare build", | ||||||
| "preview:worker": "pnpm opennextjs-cloudflare preview", | ||||||
| "preview": "pnpm build:worker && pnpm preview:worker", | ||||||
|
||||||
| "preview": "pnpm build:worker && pnpm preview:worker", | |
| "preview": "pnpm build:worker:cf && pnpm preview:worker", |
Copilot
AI
Feb 14, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build:worker-turbopack script references build:worker which no longer exists. This should reference build:worker:cf instead to work correctly.
| "build:worker-turbopack": "pnpm build:worker --openNextConfigPath open-next.turbopack.config.ts", | |
| "build:worker-turbopack": "pnpm build:worker:cf --openNextConfigPath open-next.turbopack.config.ts", |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -69,7 +69,7 @@ export function defineCloudflareConfig(config: CloudflareOverrides = {}): OpenNe | |
| tagCache, | ||
| queue, | ||
| cachePurge, | ||
| enableCacheInterception = false, | ||
| enableCacheInterception = true, | ||
|
||
| routePreloadingBehavior = "none", | ||
| } = config; | ||
|
|
||
|
|
@@ -93,6 +93,7 @@ export function defineCloudflareConfig(config: CloudflareOverrides = {}): OpenNe | |
| }, | ||
| dangerous: { | ||
| enableCacheInterception, | ||
| useAdapterOutputs: true, | ||
|
||
| }, | ||
| middleware: { | ||
| external: true, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| import { createRequire } from "node:module"; | ||
|
|
||
| import type yargs from "yargs"; | ||
|
|
||
| import { build as buildImpl } from "../build/build.js"; | ||
|
|
@@ -34,6 +36,12 @@ async function buildCommand( | |
|
|
||
| const projectOpts = { ...args, minify: !args.noMinify, sourceDir: nextAppDir }; | ||
|
|
||
| if (config.dangerous?.useAdapterOutputs) { | ||
| console.log("Using adapter outputs for building OpenNext bundle."); | ||
|
||
| const require = createRequire(import.meta.url); | ||
| process.env.NEXT_ADAPTER_PATH = require.resolve("../adapter.js"); | ||
| } | ||
|
|
||
| // Ask whether a `wrangler.jsonc` should be created when no config file exists. | ||
| // Note: We don't ask when a custom config file is specified via `--config` | ||
| // nor when `--skipWranglerConfigCheck` is used. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
previewscript still references the oldbuild:workercommand, but this has been renamed tobuild:worker:cf. This will cause the preview script to fail. Update the reference to usebuild:worker:cfinstead.