github opennextjs/opennextjs-cloudflare @opennextjs/cloudflare@1.20.20

one hour ago

Patch Changes

  • #1535 6abad6a Thanks @vicb! - chore: bump @opennextjs/aws to 4.2.2

    See details at https://github.com/opennextjs/opennextjs-aws/releases/tag/v4.2.2

    • Match redirects and headers case-insensitively.
    • Serve the 404 page for the paths that a fallback: false route does not prerender with a basePath.
    • Run Server Actions forwarded to a dynamic route.
    • Keep the use cache, fetch and unstable_cache entries during an ISR revalidation (including with Next.js 16.5).
  • #1525 002974d Thanks @ahmed-abdelkafi! - fix: serve the current version when skew protection receives a deployment id such as constructor

    Requests with a deployment id such as constructor or toString failed with "TypeError: version.split is not a function" instead of being served the current version.

  • #1511 499bba2 Thanks @vicb! - fix: run Server Actions forwarded to a dynamic route

    A Server Action posted to a page that does not bundle it (i.e. called from an effect cleanup after a client navigation) is forwarded by Next to the page that does. Since 1.20.16, it failed with "Failed to find Server Action" when that page is a dynamic route (i.e. /items/[id]/edit). The action now runs, including for catch-all routes, routes with dynamicParams = false and apps with trailingSlash: true.

    Middleware sees _forwarded-action in the dynamic segments of the forwarded request, where Next.js passes the route pattern (i.e. [id]).

  • #1276 1dcae40 Thanks @spokodev! - fix: ignore repeated initOpenNextCloudflareForDev calls with a warning

    Calling initOpenNextCloudflareForDev more than once in the Next.js config file made next dev crash with SQLite failed; database is locked: SQLITE_BUSY and The Workers runtime failed to start. Only the first call is now used, subsequent calls log a warning and are ignored.

  • #1533 ddf6463 Thanks @vicb! - fix: keep the fetch and unstable_cache entries during an ISR revalidation with Next.js 16.5

    Next.js 16.5 moved the on-demand revalidation check from the fetch and unstable_cache call sites to IncrementalCache#get, so every ISR revalidation regenerated those entries.
    The patchIncrementalCacheForISR patch from @opennextjs/aws 4.2.2 is now applied to the server bundle.

    See opennextjs/opennextjs-aws#1384 and opennextjs/opennextjs-aws#1385.

  • #1533 ddf6463 Thanks @vicb! - fix: do not load functions-config-manifest.json at runtime with Next.js 16.5

    Next.js 16.5 moved the dynamic require of functions-config-manifest.json to the new NextNodeServer#getMiddlewareConfig, which the adapter did not patch.
    Every request of an app without an edge middleware failed with a 500:

    Error: Dynamic require of "/.next/server/functions-config-manifest.json" is not supported
    

    The method is now stubbed, like loadNodeMiddleware. The middleware still runs, outside of the Next.js server.

  • #1533 ddf6463 Thanks @vicb! - fix: load the chunks of dynamic import()s with Next.js 16.5 and Turbopack

    The Turbopack runtime of Next.js 16.5 declares its own requireChunk, which installs the module factories of the chunk.
    The function generated by the adapter to inline the chunks had the same name and shadowed it, so every module loaded through a dynamic import() (e.g. in instrumentation.ts) failed with:

    Module <id> was instantiated because it was required from module <id>, but the module factory is not available.
    

    The generated function is now named requireInlinedChunk.

  • #1533 ddf6463 Thanks @vicb! - fix: patch the Turbopack wasm helpers that Next.js 16.5 emits in the chunks

    Next.js 16.5 emits the wasm helpers (compileModule and instantiate) as anonymous function expressions instead of function declarations.
    The patch silently stopped matching, so apps loading wasm with Turbopack (e.g. Prisma 7) failed at runtime with:

    TypeError: WebAssembly.compileStreaming is not a function
    

    The patch now replaces the body of the helpers, whatever form they are emitted in.

  • #1440 873d2b9 Thanks @mathurshubham! - fix: render <Head> tags from dependencies like next-seo

    Since Next.js 15.3, <Head> tags rendered by a dependency (e.g. the <title>, canonical and og: tags from next-seo) were missing from the HTML of pages rendered by the Worker, such as getServerSideProps pages and ISR fallback paths. Pages pre-rendered at build time were not affected.

  • #1529 3cd810b Thanks @ahmed-abdelkafi! - fix: accept the .workers.dev suffix for CF_PREVIEW_DOMAIN

  • #1433 80addb0 Thanks @mathurshubham! - fix: support packages with optional native addons

    The build failed when the app used a package loading a Node.js native addon, e.g. ssh2 (through cpu-features), even when the addon is optional. The error was No loader is configured for ".node" files, or Could not resolve "../build/Release/cpufeatures.node" when the addon was not built (e.g. pnpm skipping the install scripts).

    Native addons can not run on Workers. They are now replaced with a module throwing a MODULE_NOT_FOUND error, so packages treating the addon as optional work as if it was not installed. A warning lists each stubbed addon during the build: packages that require the addon fail at runtime.

  • #1502 dbe786f Thanks @haranishi! - fix: warn when the local revalidation queue is missing its service binding

Don't miss a new opennextjs-cloudflare release

NewReleases is sending notifications on new releases.