Patch Changes
-
#1473
cf1e5b9Thanks @vicb! - chore: bump@opennextjs/awsto 4.1.14See details at https://github.com/opennextjs/opennextjs-aws/releases/tag/v4.1.14
- Fix the build-time fetch cache being ignored when
deploymentIdis set. - Fix
res.revalidate()in Pages Router API routes on Next 15.4+, pages are now revalidated in-process. - Fix pages rendered on demand being reported as stale one second after they were written.
- Fix entries marked stale by
revalidateTag(tag, "max")not being served with stale-while-revalidate on Next 16.4+.
- Fix the build-time fetch cache being ignored when
-
#1449
d280ba4Thanks @vicb! - fix: invalidate CDN cache tags through the Cloudflare invalidation handlerOn-demand revalidation now purges Cloudflare cache tags through OpenNext's centralized CDN invalidation flow instead of coupling purges to the built-in tag-cache implementations.
The purge
typeis now honored for every invalidation. Previously,revalidateTagused theNEXT_CACHE_DO_PURGEDurable Object whenever it was bound and otherwise called the Cloudflare API directly, regardless oftype.Direct invalidation now rejects unsuccessful API outcomes. In Durable Object mode, a missing
NEXT_CACHE_DO_PURGEbinding now logs an error and skips the purge for both tag and path invalidation.revalidateTagno longer falls back to unbuffered direct purges, which count against the account-wide purge rate limit. Add the binding to restore CDN purges.When cache purge is configured without
CACHE_PURGE_ZONE_IDorCACHE_PURGE_API_TOKEN, on-demand revalidation still updates the tag cache, but the purge is now reported as a failed CDN invalidation (Cloudflare cache purge failed: missing-credentials) rather than a skipped purge. Set both variables, or remove thecdnInvalidationoverride if CDN purging is not needed.Custom Durable Objects can extend
BucketCachePurgeBaseand override its protected storage, batching, execution, and settlement hooks to support alternate schemas while retaining alarm scheduling and queue draining. The concreteBucketCachePurgeclass preserves the default single-zone behavior. -
#1429
6026fedThanks @mathurshubham! - fix: copy the workerd build of every traced package, not only ofserverExternalPackagesThe Cloudflare build of a package exposed through the
workerdexport condition was only included for packages listed inserverExternalPackages. Packages that Next.js keeps external on its own, and their dependencies, were missing it.For example, building a Next.js 16 app using
pgor@prisma/adapter-pg(the Hyperdrive setup) with Turbopack failed with:✘ [ERROR] Could not resolve "pg-cloudflare" The module "./dist/index.js" was not found on the file systemThe
workerdbuild of every package is now used, sopgbuilds withoutoutputFileTracingIncludesworkarounds. A package with aworkerdcondition now always uses that build, even when it is not listed inserverExternalPackages. -
#1430
8a9be4eThanks @rishabhvenu! - fix: bundle the Node.js middleware (proxy.ts) when@opentelemetry/apiis installedSince 1.20.3,
opennextjs-cloudflare buildfailed withCould not resolve "@opentelemetry/api"for apps with a Node.js middleware and@opentelemetry/apiinstalled, for example as a dependency of@sentry/nextjs. -
#1473
cf1e5b9Thanks @vicb! - fix: use the Open Next build id for the Durable Objects and drop the unused cache assets SQL manifest- The Durable Objects now use
getOpenNextBuildId()from@opennextjs/aws, so an emptydeploymentIdfalls back to the build id. The queue Durable Object now clears the state of previous builds in that case. .open-next/cloudflare/cache-assets-manifest.sqlis no longer generated. It seeded the D1 tag cache used before 1.0 and no current tag cache reads it.
- The Durable Objects now use
-
#1332
7fe40aaThanks @yuanzhixiang! - fix: support a custombuildOutputPathin thedeploy,preview,uploadandpopulateCachecommandsWith
buildOutputPathset inopen-next.config.ts, these commands failed right after a successful build withCould not find compiled Open Next config, did you run the build command?. They now find the build output under the configuredbuildOutputPath. -
#1438
803d221Thanks @mathurshubham! - fix: resolve Turbopack hashed externals through their symlink under pnpmWith Turbopack and pnpm, packages listed in
serverExternalPackageswere bundled using their Node.js
build instead of theirworkerdbuild. For examplepostgreswas bundled withoutcloudflare:sockets
support and failed at runtime.The
workerdbuild is now used. This also fixes externals that are not direct dependencies of the app,
and npm aliases. -
#1332
7fe40aaThanks @yuanzhixiang! - fix: find@vercel/ogin the appnode_moduleswhen a custombuildOutputPathis setWhen
.nextwas inbuildOutputPathandnode_modulesnext to the app, the build failed withENOENT: no such file or directory, copyfile '.../next/dist/compiled/@vercel/og/index.edge.js'.