Skip to content

Fix for cloudflare e2e test#22

Merged
conico974 merged 7 commits intomainfrom
conico/e2e-cloudflare
Feb 14, 2026
Merged

Fix for cloudflare e2e test#22
conico974 merged 7 commits intomainfrom
conico/e2e-cloudflare

Conversation

@conico974
Copy link
Contributor

Oops I merged it into the other branch instead of main.

Copilot AI review requested due to automatic review settings February 14, 2026 16:17
@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 14, 2026

Open in StackBlitz

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

commit: 993eede

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR implements fixes for the Cloudflare e2e tests by enabling the Next.js adapter API integration. The changes introduce support for using adapter outputs in the build process, update task definitions for the Cloudflare-specific tests, and skip several failing tests with TODO comments indicating they need to be fixed in subsequent PRs.

Changes:

  • Enabled useAdapterOutputs flag and changed enableCacheInterception default to true in Cloudflare config
  • Renamed npm scripts from build:worker and e2e to build:worker:cf and e2e:cf for e2e test directories
  • Added new GitHub Actions workflow job for Cloudflare e2e tests
  • Skipped multiple failing tests with TODO comments documenting issues
  • Removed obsolete code related to the old build approach (plugin removal, unused imports)
  • Added .wrangler/ to .gitignore

Reviewed changes

Copilot reviewed 23 out of 24 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
turbo.json Added task definitions for e2e:cf and build:worker:cf
packages/cloudflare/src/cli/commands/build.ts Added adapter path resolution when useAdapterOutputs is enabled
packages/cloudflare/src/cli/build/open-next/createServerBundle.ts Removed obsolete plugin code and imports related to old build approach
packages/cloudflare/src/cli/build/build.ts Added early return when useAdapterOutputs is enabled
packages/cloudflare/src/api/config.ts Changed enableCacheInterception default to true, hardcoded useAdapterOutputs to true
examples-cloudflare/e2e/*/package.json Renamed build:worker → build:worker:cf and e2e → e2e:cf
examples-cloudflare/e2e/pages-router/open-next.config.ts Added explicit enableCacheInterception: true
examples-cloudflare/e2e//e2e/.test.ts Skipped multiple failing tests with TODO comments
.gitignore Added .wrangler/ directory
.github/workflows/local.yml Added cloudflare job for e2e testing

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

"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 build:worker --openNextConfigPath open-next.turbopack.config.ts",
Copy link

Copilot AI Feb 14, 2026

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.

Suggested change
"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",

Copilot uses AI. Check for mistakes.
"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",
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

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

The preview script still references the old build:worker command, but this has been renamed to build:worker:cf. This will cause the preview script to fail. Update the reference to use build:worker:cf instead.

Suggested change
"preview": "pnpm build:worker && pnpm preview:worker",
"preview": "pnpm build:worker:cf && pnpm preview:worker",

Copilot uses AI. Check for mistakes.
"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",
Copy link

Copilot AI Feb 14, 2026

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.

Suggested change
"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",

Copilot uses AI. Check for mistakes.
queue,
cachePurge,
enableCacheInterception = false,
enableCacheInterception = true,
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

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

The JSDoc comment indicates the default for enableCacheInterception is false, but the code sets it to true. The documentation should be updated to reflect the actual default value.

Copilot uses AI. Check for mistakes.
},
dangerous: {
enableCacheInterception,
useAdapterOutputs: true,
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

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

The useAdapterOutputs is hardcoded to true for all Cloudflare configurations, which forces all users to use the adapter outputs approach. If this is intended to be a temporary change for testing purposes, consider making it configurable or document this breaking change. If it's permanent, this represents a significant architectural change that should be clearly documented.

Copilot uses AI. Check for mistakes.

export default defineCloudflareConfig({
incrementalCache: r2IncrementalCache,
enableCacheInterception: true,
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

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

The explicit enableCacheInterception: true is now redundant since the default value has been changed to true in the config. This line can be removed unless there's a specific reason to keep it explicit for documentation purposes.

Suggested change
enableCacheInterception: true,

Copilot uses AI. Check for mistakes.
const projectOpts = { ...args, minify: !args.noMinify, sourceDir: nextAppDir };

if (config.dangerous?.useAdapterOutputs) {
console.log("Using adapter outputs for building OpenNext bundle.");
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

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

Using console.log is inconsistent with the logging convention used throughout the codebase. The rest of the codebase uses the logger from @opennextjs/aws/logger.js for logging messages. Consider importing logger and using logger.info() instead for consistency.

Copilot uses AI. Check for mistakes.
"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",
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

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

The preview script still references the old build:worker command, but this has been renamed to build:worker:cf. This will cause the preview script to fail. Update the reference to use build:worker:cf instead.

Suggested change
"preview": "pnpm build:worker && pnpm preview:worker",
"preview": "pnpm build:worker:cf && pnpm preview:worker",

Copilot uses AI. Check for mistakes.
"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 build:worker --openNextConfigPath open-next.turbopack.config.ts",
Copy link

Copilot AI Feb 14, 2026

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.

Suggested change
"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",

Copilot uses AI. Check for mistakes.
"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",
Copy link

Copilot AI Feb 14, 2026

Choose a reason for hiding this comment

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

The preview script still references the old build:worker command, but this has been renamed to build:worker:cf. This will cause the preview script to fail. Update the reference to use build:worker:cf instead.

Suggested change
"preview": "pnpm build:worker && pnpm preview:worker",
"preview": "pnpm build:worker:cf && pnpm preview:worker",

Copilot uses AI. Check for mistakes.
@conico974 conico974 merged commit cb4e81d into main Feb 14, 2026
14 checks passed
@conico974 conico974 deleted the conico/e2e-cloudflare branch February 14, 2026 16:23
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.

2 participants