Skip to content

Commit 2232651

Browse files
authored
Update Next.js to version 16.2.2 and adjust Open Graph handling (#1176)
* chore: update next.js version from 16.1.4 to 16.2.2 in pnpm-workspace.yaml * fix: update MD5 checksums for Open Graph images and add WASM file copying for Next.js 16.2+ * prettier
1 parent f89fba1 commit 2232651

4 files changed

Lines changed: 187 additions & 98 deletions

File tree

examples/e2e/app-router/e2e/og.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { expect, test } from "@playwright/test";
22
import { validateMd5 } from "../../utils";
33

44
// This is the md5sums of the expected PNGs generated with `md5sum <file>`
5-
const OG_MD5 = "83cfda4e78b037aa3d9ab465292550ef";
6-
const API_OG_MD5 = "6a22b4ff74e0dd8c377e2640dafe3e40";
5+
const OG_MD5 = "db156985b60003a865f90a65670ab5d0";
6+
const API_OG_MD5 = "7e9c67b3c58f7d81b287c64060d9af5d";
77

88
test("Open-graph image to be in metatags and present", async ({ page, request }) => {
99
await page.goto("/og");

packages/cloudflare/src/cli/build/patches/ast/patch-vercel-og-library.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,15 @@ export function patchVercelOgLibrary(buildOpts: BuildOptions): boolean {
4747
);
4848

4949
copyFileSync(tracedEdgePath, outputEdgePath);
50+
51+
// On Next 16.2 and above, we also need to copy the yoga.wasm file used by the library.
52+
const tracedWasmPath = path.join(
53+
path.dirname(traceInfoPath),
54+
tracedNodePath.replace("index.node.js", "yoga.wasm")
55+
);
56+
if (existsSync(tracedWasmPath)) {
57+
copyFileSync(tracedWasmPath, path.join(outputDir, "yoga.wasm"));
58+
}
5059
}
5160

5261
// Change font fetches in the library to use imports.

0 commit comments

Comments
 (0)