Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/seven-ducks-dig.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@opennextjs/cloudflare": patch
---

fix: make sure the edge adapter loads a patched Next config

Fixes an issue in Next where `skipTrailingSlashRedirect` is not part of the config.
The bug has been introduced in Next by https://github.com/vercel/next.js/pull/86830
6 changes: 3 additions & 3 deletions examples/common/config-e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ export function configurePlaywright(

const projects = [
{
name: "chromium",
name: `${app} - chromium`,
use: { ...devices["Desktop Chrome"] },
},
{
name: "firefox",
name: `${app} - firefox`,
use: { ...devices["Desktop Firefox"] },
},
{
name: "webkit",
name: `${app} - webkit`,
use: { ...devices["Desktop Safari"] },
},
];
Expand Down
7 changes: 6 additions & 1 deletion examples/e2e/experimental/next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@ const nextConfig: NextConfig = {
/* config options here */
cleanDistDir: true,
output: "standalone",
cacheComponents: true,
eslint: {
ignoreDuringBuilds: true,
},
typescript: {
// Ignore type errors during build for now, we'll need to figure this out later
ignoreBuildErrors: true,
},
experimental: {
cacheComponents: true,
},
};

export default nextConfig;
4 changes: 2 additions & 2 deletions examples/e2e/experimental/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"scripts": {
"dev": "next dev --turbopack --port 3004",
"build": "next build --webpack",
"build": "next build",
"start": "next start --port 3004",
"lint": "next lint",
"clean": "rm -rf .turbo node_modules .next .open-next",
Expand All @@ -15,7 +15,7 @@
},
"dependencies": {
"@opennextjs/cloudflare": "workspace:*",
"next": "catalog:e2e",
"next": "15.4.2-canary.29",
"react": "catalog:e2e",
"react-dom": "catalog:e2e"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/e2e/experimental/src/app/api/revalidate/route.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { revalidateTag } from "next/cache";

export function GET() {
revalidateTag("fullyTagged", "max");
revalidateTag("fullyTagged");
return new Response("DONE");
}
2 changes: 2 additions & 0 deletions examples/e2e/experimental/src/app/ppr/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { DynamicComponent } from "@/components/dynamic";
import { StaticComponent } from "@/components/static";
import { Suspense } from "react";

export const experimental_ppr = true;

export default function PPRPage() {
return (
<div>
Expand Down
3 changes: 0 additions & 3 deletions examples/e2e/experimental/src/app/use-cache/ssr/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,12 @@ export default async function Page() {
<div>
<h1>Cache</h1>
<p>{_headers.get("accept") ?? "No accept headers"}</p>
<h2>cached:</h2>
<Suspense fallback={<p>Loading...</p>}>
<FullyCachedComponent />
</Suspense>
<h2>cached (with tag):</h2>
<Suspense fallback={<p>Loading...</p>}>
<FullyCachedComponentWithTag />
</Suspense>
<h2>isr:</h2>
<Suspense fallback={<p>Loading...</p>}>
<ISRComponent />
</Suspense>
Expand Down
6 changes: 3 additions & 3 deletions examples/e2e/experimental/src/components/cached.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { cacheLife, cacheTag } from "next/cache";
import { unstable_cacheLife, unstable_cacheTag } from "next/cache";

export async function FullyCachedComponent() {
"use cache";
Expand All @@ -11,7 +11,7 @@ export async function FullyCachedComponent() {

export async function FullyCachedComponentWithTag() {
"use cache";
cacheTag("fullyTagged");
unstable_cacheTag("fullyTagged");
return (
<div>
<p data-testid="fully-cached-with-tag">{Date.now()}</p>
Expand All @@ -21,7 +21,7 @@ export async function FullyCachedComponentWithTag() {

export async function ISRComponent() {
"use cache";
cacheLife({
unstable_cacheLife({
stale: 1,
revalidate: 5,
});
Expand Down
4 changes: 2 additions & 2 deletions examples/e2e/experimental/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "react-jsx",
"jsx": "preserve",
"incremental": true,
"plugins": [
{
Expand All @@ -22,6 +22,6 @@
"@/*": ["./src/*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", ".next/dev/types/**/*.ts"],
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}
2 changes: 1 addition & 1 deletion examples/playground16/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"cf-typegen": "wrangler types --env-interface CloudflareEnv"
},
"dependencies": {
"next": "16.0.10",
"next": "16.1.3",
"react-dom": "19.2.3",
"react": "19.2.3"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/cloudflare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"dependencies": {
"@ast-grep/napi": "0.40.0",
"@dotenvx/dotenvx": "catalog:",
"@opennextjs/aws": "3.9.8",
"@opennextjs/aws": "3.9.9",
"cloudflare": "^4.4.1",
"enquirer": "^2.4.1",
"glob": "catalog:",
Expand Down
3 changes: 3 additions & 0 deletions packages/cloudflare/src/cli/build/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { compileCache } from "@opennextjs/aws/build/compileCache.js";
import { createCacheAssets, createStaticAssets } from "@opennextjs/aws/build/createAssets.js";
import { createMiddleware } from "@opennextjs/aws/build/createMiddleware.js";
import * as buildHelper from "@opennextjs/aws/build/helper.js";
import { patchOriginalNextConfig } from "@opennextjs/aws/build/patch/patches/index.js";
import { printHeader } from "@opennextjs/aws/build/utils.js";
import logger from "@opennextjs/aws/logger.js";
import type { Unstable_Config } from "wrangler";
Expand Down Expand Up @@ -68,6 +69,8 @@ export async function build(
// Generate deployable bundle
printHeader("Generating bundle");

await patchOriginalNextConfig(options);

compileCache(options);
compileEnvFiles(options);
await compileInit(options, wranglerConfig);
Expand Down
Loading
Loading