Skip to content

Fix build issues and end-to-end tests using adapter api for aws#10

Merged
conico974 merged 21 commits intomainfrom
conico/basic-e2e
Feb 14, 2026
Merged

Fix build issues and end-to-end tests using adapter api for aws#10
conico974 merged 21 commits intomainfrom
conico/basic-e2e

Conversation

@conico974
Copy link
Contributor

@conico974 conico974 commented Jan 24, 2026

For aws :

  • Fix app-router test
  • Fix app-page-router
  • Fix page-router

This PR already includes a bunch of changes, and I think it would make sense to first merge this one and fix and probably refactor cloudflare ones in another PR

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 31, 2026

Open in StackBlitz

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

commit: 6eeef5c

@conico974 conico974 marked this pull request as ready for review February 14, 2026 12:16
@conico974 conico974 requested a review from Copilot February 14, 2026 12:17
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 updates the AWS build/test setup to use the Next.js adapter API outputs (instead of the legacy NextServer-based runtime path) and bumps dependencies to address build and routing/test failures, with additional local E2E workflow wiring.

Changes:

  • Bump AWS Next.js catalog version to 16.1.4 and refresh lockfile (incl. Playwright/Express-related updates).
  • Introduce ResolvedRoute.isFallback and filter out prerendered fallback: false dynamic routes during routing to correctly produce 404s.
  • Shift the request/runtime path toward the adapter handler flow and update build/copy/plugin logic to support adapter outputs and monorepo packagePath.

Reviewed changes

Copilot reviewed 51 out of 52 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
pnpm-workspace.yaml Bumps AWS catalog Next.js version to 16.1.4.
pnpm-lock.yaml Lockfile refresh for Next/Playwright/Express and transitive updates.
packages/tests-unit/tests/core/routing/routeMatcher.test.ts Adds unit coverage for isFallback and fallback-false dynamic route matching.
packages/tests-unit/tests/core/routing/matcher.test.ts Updates config mock to include PrerenderManifest shape.
packages/tests-unit/tests/adapters/cache.test.ts Updates expected ResolvedRoute shape with isFallback.
packages/tests-e2e/tests/pagesRouter/header.test.ts Adjusts header assertions (currently comments out x-powered-by).
packages/tests-e2e/tests/pagesRouter/fallback.test.ts Skips a fallback E2E test due to cache interception limitations.
packages/tests-e2e/tests/appRouter/sse.test.ts Skips SSE E2E test due to runtime crash.
packages/tests-e2e/tests/appRouter/revalidateTag.test.ts Changes cache-header expectations post revalidate-tag.
packages/tests-e2e/tests/appRouter/isr.revalidate.test.ts Skips ISR revalidate E2E test.
packages/tests-e2e/tests/appRouter/dynamic.catch-all.hypen.test.ts Skips dynamic catch-all hyphen E2E test.
packages/tests-e2e/tests/appRouter/config.redirect.test.ts Skips redirect encoding-related E2E tests.
packages/tests-e2e/tests/appPagesRouter/api.test.ts Skips client API-call E2E test due to adapter import issue.
packages/tests-e2e/playwright.config.js Comments out the experimental Playwright project.
packages/tests-e2e/package.json Switches Playwright dependency to catalog:.
packages/open-next/src/utils/promise.ts Changes detached promise handling/logging behavior.
packages/open-next/src/types/open-next.ts Adds ResolvedRoute.isFallback to the public type.
packages/open-next/src/types/global.ts Disables __next_route_preloader global typing (commented out).
packages/open-next/src/plugins/inlineRouteHandlers.ts Adds packagePath support when collecting/inlining chunks; updates external chunks plugin signature.
packages/open-next/src/overrides/wrappers/express-dev.ts Fixes Express catch-all route matching pattern.
packages/open-next/src/overrides/wrappers/aws-lambda-streaming.ts Disables route preloader invocation on warmer events (commented out).
packages/open-next/src/core/util.ts Removes legacy NextServer-based util implementation.
packages/open-next/src/core/util.adapter.ts Removes adapter-specific util shim (no longer used).
packages/open-next/src/core/routingHandler.ts Recomputes post-rewrite matches and filters fallback-false dynamic routes before deciding 404.
packages/open-next/src/core/routing/routeMatcher.ts Adds prerender fallback-false detection and isFallback on resolved routes.
packages/open-next/src/core/routing/adapterHandler.ts Adds explicit 404/500 handling + waitUntil plumbing in adapter handler.
packages/open-next/src/core/requestHandler.ts Routes through adapterHandler, removes legacy processRequest path, sets explicit status codes for /404 and /500.
packages/open-next/src/core/createMainHandler.ts Disables route preloader on start (commented out).
packages/open-next/src/build/createServerBundle.ts Adjusts adapter output copy path handling; removes util override plugin usage.
packages/open-next/src/build/createAssets.ts Fixes .next path selection when using adapter outputs.
packages/open-next/src/build/copyAdapterFiles.ts Adds packagePath param; supports copying middleware output; updates output paths.
packages/open-next/src/build.ts Enables adapter outputs via NEXT_ADAPTER_PATH and early-returns (delegate artifact generation to adapter).
packages/open-next/src/adapters/middleware.ts Updates ResolvedRoute shape to include isFallback.
packages/open-next/src/adapters/cache.ts Guards openNextConfig access and updates ResolvedRoute shape.
packages/open-next/src/adapter.ts Adds packagePath handling, cache file placement updates, and passes packagePath to plugins.
packages/open-next/package.json Bumps Express and @types/express.
packages/cloudflare/src/cli/build/open-next/createServerBundle.ts Passes packagePath into adapter file copying.
packages/cloudflare/src/cli/adapter.ts Passes packagePath into inline route handler plugin.
examples/pages-router/src/pages/sse/index.tsx Removes "use client" and adds getStaticProps; renames component.
examples/pages-router/package.json Simplifies local build scripts and adjusts env for local start.
examples/pages-router/open-next.config.ts Switches example to local dev overrides and enables useAdapterOutputs + cache interception.
examples/pages-router/open-next.config.local.ts Removes separate local config file.
examples/pages-router/next.config.ts Tweaks rewrite source to include trailing slash.
examples/experimental/package.json Removes local build scripts.
examples/app-router/package.json Removes local build script variant.
examples/app-router/open-next.config.ts Switches to local dev overrides; enables adapter outputs + cache interception; adds imageOptimization overrides.
examples/app-router/open-next.config.local.ts Removes separate local config file.
examples/app-pages-router/package.json Simplifies local build script; adds Express deps/types for proxy dev flow.
examples/app-pages-router/open-next.config.ts Consolidates dev overrides; enables adapter outputs + cache interception; adds imageOptimization overrides.
examples/app-pages-router/open-next.config.local.ts Removes separate local config file.
examples/app-pages-router/on-proxy.ts Adjusts proxy routing patterns and env vars for spawned servers.
.github/workflows/local.yml Adds local E2E workflow to build/run examples and execute Playwright tests.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)

packages/open-next/src/core/routing/adapterHandler.ts:39

  • In the route loop, returning when getHandler(route) is undefined aborts routing entirely and bypasses the final 404 handling. This can lead to requests never being handled if the first resolvedRoute isn't inlined. Replace the early return with a continue (and only return after a handler successfully runs or after the loop finishes).
	for (const route of routingResult.resolvedRoutes) {
		const module = getHandler(route);
		if (!module || resolved) {
			return;
		}

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

@conico974 conico974 changed the title Fix build issues and end-to-end tests using adapter api Fix build issues and end-to-end tests using adapter api for aws Feb 14, 2026
Copy link
Contributor

@vicb vicb left a comment

Choose a reason for hiding this comment

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

Thanks Nico!

@conico974 conico974 merged commit c8da9a7 into main Feb 14, 2026
7 checks passed
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