-
#1221
a2679bfThanks @mushan0x0! - Stop bundling@vercel/og(and its ~1.4 MiBresvg.wasm) when the app does not use it.Next.js's
externalImporthelper keeps a dynamicimport("next/dist/compiled/@vercel/og/index.edge.js")in the emitted handler even for apps that never useImageResponse/opengraph-image. Previously this module was marked asexternalwhenuseOgwasfalse, which left Wrangler to resolve and bundle it — pulling in ~800 KiB of JS plusresvg.wasmand pushing many Workers over the Cloudflare free-tier 3 MiB gzip limit.When
useOgisfalse, the edge entry is now aliased to the existingthrow.jsshim, so the unreachable dynamic import resolves to a tiny module and the real@vercel/oglibrary is no longer pulled into the Worker bundle. -
#1208
2c5b472Thanks @edmundhung! - UseOPEN_NEXT_BUILD_IDinstead ofNEXT_BUILD_IDin the cache keys.As of Next 16.2
NEXT_BUILD_IDis a fixed value when deploymentId is set explicitly. -
#1193
1e8d232Thanks @conico974! - Fix tag cache stale logic
-
#1215
608893eThanks @vicb! - Factor large repeated values in manifestsThis reduce the size of the generated code.
-
#1218
f0d0226Thanks @314systems! - removeprocess.versionoverrideRemove process.version / process.versions.node overrides now that unjs/unenv#493 is merged and shipped in unenv@2.0.0-rc.16 (project uses 2.0.0-rc.24)
-
#1199
32594d6Thanks @SdSadat! - fix(cli): fail fast in non-TTY environments instead of hanging on config-creation promptsWhen
open-next.config.ts(orwrangler.(toml|json|jsonc)) is missing, the CLI prompts the user to auto-create it. In non-TTY environments (Cloudflare Workers Builds, Docker, CI) the Enquirer prompt can't read stdin, so the build hangs or fails with a truncated prompt and a cryptic exit code — the user sees? Missing required open-next.config.ts file, do you want to create one? (Y/n)and thenELIFECYCLE Command failed with exit code 13, with no hint at what to do next.Now, in non-interactive environments, both prompts throw an actionable error with the exact template to paste (for
open-next.config.ts) or point at the existing--skipWranglerConfigCheck/SKIP_WRANGLER_CONFIG_CHECKescape hatch (for the wrangler config). Interactive behavior is unchanged.
-
#1207
0958726Thanks @edmundhung! - bump@opennextjs/awsto 3.10.2See details at https://github.com/opennextjs/opennextjs-aws/releases/tag/v3.10.2
-
#1139
79b01b8Thanks @james-elicx! - Fix Turbopack external module resolution by dynamically discovering external imports at build time.When packages are listed in
serverExternalPackages, Turbopack externalizes them viaexternalImport()which uses dynamicawait import(id). The bundler (ESBuild) can't statically analyzeimport(id)with a variable, so these modules aren't included in the worker bundle.This patch:
- Discovers hashed Turbopack external module mappings from
.next/node_modules/symlinks (e.g.shiki-43d062b67f27bbdc→shiki) - Scans traced chunk files for bare external imports (e.g.
externalImport("shiki")) and subpath imports (e.g.shiki/engine/javascript) - Generates explicit
switch/caseentries so the bundler can statically resolve and include these modules
- Discovers hashed Turbopack external module mappings from
-
#1203
6f02d12Thanks @314systems! - fix: exclude unsupported Next.js 16 releases from peer dependencies.The previous range allowed Next.js 16.0.0 through 16.2.2 without a peer dependency warning because
>=16.2.3was already covered by>=15.5.15.The range now explicitly supports Next.js 15.5.15 and above in the 15.x line, and Next.js 16.2.3 and above in the 16.x line.
-
#1200
7820ad0Thanks @NathanDrake2406! - fix: reuse sharded tag data when filling the regional cache.The sharded tag cache miss path already reads tag data from the Durable Object before answering the request. Reuse that fetched data when populating the regional cache so a shard miss does not immediately trigger a second identical Durable Object read.
-
#1206
585795dThanks @314systems! - fix: regression where getEnvFromPlatformProxy received wrong options typeThis fixes a regression introduced in 32ba91a where
getEnvFromPlatformProxycall sites passedOpenNextConfigeven though the function expects WranglerGetPlatformProxyOptions.The fix restores the pre-32ba91a argument shape by passing
{ configPath, environment }from CLI arguments, so env resolution follows the selected Wrangler config/environment.
- #1189
236ce14Thanks @fatihy101! - fix(tag-cache): forwardisStale()inwithFilter
-
#1168
9a26846Thanks @conico974! - Add support for SWR (stale-while-revalidate) inrevalidateTagSee the AWS implementation for more details.
-
#1184
c7d6425Thanks @vicb! - fix for Next.js CVE-2026-23869See the CVE-2026-23869 summary for details.
This CVE is fixed by bumping the minium Next.js release version to 15.5.15/16.2.3
-
#1177
e814a63Thanks @conico974! - Fixuse cachenot working as expected in Next 16+
-
#1176
2232651Thanks @conico974! - fix for OG with Next 16.2.2 -
#1166
f89fba1Thanks @ash1day! - fix: sort.endsWith()checks by path length descending to prevent suffix collisions in dynamic requiresRoutes whose paths are suffixes of other routes (e.g.
/test/appvs/) were resolved incorrectly because the shorter path matched first in the generated.endsWith()chain. Sorting by path length descending ensures more specific (longer) paths are always checked first.Fixes #1156.
-
#1159
75f5f0aThanks @edmundhung! - Use remote dev for R2 cache populationUsing remote dev is not subject to the Cloudflare API rate limit of 1,200 requests per 5 minutes that caused failures for large applications with thousands of prerendered pages.
-
#1160
161e726Thanks @matthewvolk! - fix(patches): includeprefetch-hints.jsonin loadManifest build-time inliningNext.js 16.2.0 introduced
prefetch-hints.jsonas a new server manifest loaded unconditionally byNextNodeServer.getPrefetchHints(). The file exists in the build output but wasn't matched by the glob pattern*-manifest.json, causing the patchedloadManifest()to throw at runtime.
-
#1151
a143282Thanks @nathanschram! - fix: handle known optional manifests gracefully in loadManifest/evalManifest patchesNext.js loads certain manifests with
handleMissing: true(returning{}when the file doesn't exist). The adapter's build-time glob scan doesn't find these files when they're conditionally generated, so the patched function threw at runtime, crashing dynamic routes with 500.Instead of a blanket catch-all, handle only the specific optional manifests from Next.js
route-module.ts:react-loadable-manifest(Turbopack per-route, not all routes have dynamic imports)subresource-integrity-manifest(only whenexperimental.sriconfigured)server-reference-manifest(App Router only)dynamic-css-manifest(Pages Router + Webpack only)fallback-build-manifest(only for/_errorpage)prefetch-hints(new in Next.js 16.2)_client-reference-manifest.js(optional for static metadata routes, evalManifest)
Manifest matching strips
.jsonbefore comparison since some Next.js constants omit the extension (SUBRESOURCE_INTEGRITY_MANIFEST,DYNAMIC_CSS_MANIFEST, etc.).Unknown manifests still throw to surface genuine errors.
Fixes #1141.
- #1133
25d5835Thanks @dario-piotrowicz! - Update themigratecommand to attempt to create an R2 bucket for caching, if that is not possible an application without caching enabled will be generated instead.
- #1138
4487f1fThanks @james-elicx! - Fix the CLI potentially setting a future compatibility date in the wrangler config when workerd has published a version matching a future date, by capping to the current date.
-
#1127
2b437f1Thanks @dario-piotrowicz! - In themigratecommand, add an initial step to create a Next.js config file (required by open-next) if it doesn't exist -
#1126
8c3a36eThanks @alex-all3dp! - fix: prevent Worker hang on HEAD requests to static assets
-
#1122
6c94a4aThanks @dario-piotrowicz! - Inmigratecommand, avoid adding unnecessary newlines when creating files -
#1122
6c94a4aThanks @dario-piotrowicz! - fixmigratecommand incorrectly erroring if the target application doesn't have apublicdirectory -
#1122
6c94a4aThanks @dario-piotrowicz! - Bump@opennextjs/awsto 3.9.16See details at https://github.com/opennextjs/opennextjs-aws/releases/tag/v3.9.16
-
#1097
fea645fThanks @dario-piotrowicz! - Add--helpand--versionto theopennextjs-cloudflareCLIImprove the
opennextjs-cloudflareCLI by:- ensuring that unknown commands (e.g.,
opennextjs-cloudflare foo) display a clear and helpful error message - adding a
-h|--helpflag to display the CLI's help message - adding a
-v|--versionflag to display the package's version
- ensuring that unknown commands (e.g.,
-
#1113
09c41f1Thanks @anonrig! - bump@opennextjs/awsto 3.9.15See details at https://github.com/opennextjs/opennextjs-aws/releases/tag/v3.9.15
- #1100
8676c78Thanks @vicb! - EmptyNextNodeServer#handleNextImageRequestto avoid pulling unneeded deps (in #1098)
-
#1083
b062597Thanks @dario-piotrowicz! - feature: addmigratecommand to set up OpenNext for Cloudflare adapterThis command helps users migrate existing Next.js applications to the OpenNext Cloudflare adapter by automatically setting up all necessary configuration files, dependencies, and scripts.
To use the command simply run:
npx opennextjs-cloudflare migrate
-
#1092
4279043Thanks @vicb! - Check for supported Next versionThe build will now error for unsupported Next version which may contain unpatched security vulnerabilities. You can bypass the check using the
--dangerouslyUseUnsupportedNextVersionflag.
-
#1076
c99eefdThanks @vicb! - fix: do not bundle og when not usedThis saves ~500kB when og is not used
-
#1079
6ac789aThanks @vicb! - fix: use the correct runtime (i.e. webpack or turbopack) -
#1078
249f738Thanks @vicb! - drop unused react-dom modulesThis saves ~500kB on the output bundle
-
#1071
886c742Thanks @vicb! - fix: patch Next config for missing fields.There was a regression in Next 16.1.0 (vercel/next.js#86830) and some fields were missing in the config. The Next team fixed that in 16.1.4 (vercel/next.js#88733).
This PR introduce a patch for 16.1.0-16.1.3
-
#1070
f7c6b3aThanks @vicb! - bump@opennextjs/awsto 3.9.8See details at https://github.com/opennextjs/opennextjs-aws/releases/tag/v3.9.8
-
#1057
0230cbeThanks @vicb! - Do not inject setImmediate/clearImmediate in the global scope -
#1069
4ee4ba3Thanks @vicb! - Check that wrangler is >= 4.59.2 when building Next 16.1+.To ensure
workerdhas a required fix tosetImmediate
-
#1042
763c4ecThanks @vicb! - Bump Next, React, and @opennextjs/aws to fix vulnerabilities (CVE-2025-55184 and CVE-2025-55183)See https://react.dev/blog/2025/12/11/denial-of-service-and-source-code-exposure-in-react-server-components See https://nextjs.org/blog/security-update-2025-12-11 See https://github.com/opennextjs/opennextjs-aws/releases/tag/v3.9.5
-
#1034
721bff0Thanks @james-elicx! - output more wrangler command logs when the command fails -
#1023
a4a2f02Thanks @dario-piotrowicz! - When runningwrangler deployadd aOPEN_NEXT_DEPLOYenvironment variable to let wrangler know that it is being run by open-next
-
#1020
07919d8Thanks @dario-piotrowicz! - Add missing WORKER_SELF_REFERENCE service binding in the wrangler.jsonc that the CLI creates -
#1032
1de4899Thanks @vicb! - fix(images): allow any local path when no localPatterns are specified
-
#1025
c3aba94Thanks @vicb! - bump@opennextjs/awsto 3.9.4See details at https://github.com/opennextjs/opennextjs-aws/releases/tag/v3.9.4
-
#1021
250aba2Thanks @vicb! - bump@opennextjs/awsto 3.9.3See details at https://github.com/opennextjs/opennextjs-aws/releases/tag/v3.9.3
-
#1016
2200b4bThanks @vicb! - Update e2e tests to Next 16 (webpack) -
#1015
e8971cdThanks @vicb! - memory queue: retrieve the preview ID fromprocess.env -
#1012
5f6c0a6Thanks @pilcrowonpaper! - Add image binding to Wrangler configuration template file -
#1017
a6904a4Thanks @vicb! - fix:response.validatewith the turbo pages runtime -
#1014
f4b53b9Thanks @vicb! - bump@opennextjs/awsto 3.9.1See details at https://github.com/opennextjs/opennextjs-aws/releases/tag/v3.9.1
- #999
50d7427Thanks @pilcrowonpaper! - feat: support image optimization using the image binding
-
#994
ab2d805Thanks @vicb! - bump@opennextjs/awsto 3.9.0See details at https://github.com/opennextjs/opennextjs-aws/releases/tag/v3.9.0
-
#973
8cb7669Thanks @petebacondarwin! - Add standard Next template generated from create-next-app that will be used by create-cloudflare going forward
-
#968
ddb0589Thanks @rgembalik! - fix: Compiled config is now imported usingpathToFileURLto avoid crashes on Windows. -
#978
d7ad53eThanks @vicb! - error early when a node middleware is detected -
#976
93f4c8aThanks @rgembalik! - fix: shell quoting on windows machines to avoid upload errors for routes with[...path]segments
-
#925
62fee71Thanks @krzysztof-palka-monogo! - feature: optional batch upload for faster R2 cache populationThis update adds optional batch upload support for R2 cache population, significantly improving upload performance for large caches when enabled via .env or environment variables.
Key Changes:
-
Optional Batch Upload: Configure R2 credentials via .env or environment variables to enable faster batch uploads:
R2_ACCESS_KEY_IDR2_SECRET_ACCESS_KEYCF_ACCOUNT_ID
-
Automatic Detection: When credentials are detected, batch upload is automatically used for better performance
-
Smart Fallback: If credentials are not configured, the CLI falls back to standard Wrangler uploads with a helpful message about enabling batch upload for better performance
All deployment commands support batch upload:
populateCache- Explicit cache populationdeploy- Deploy with cache populationupload- Upload version with cache populationpreview- Preview with cache population
Performance Benefits (when batch upload is enabled):
- Parallel transfer capabilities (32 concurrent transfers)
- Significantly faster for large caches
- Reduced API calls to Cloudflare
Usage:
Add the credentials in a
.env/.dev.varsfile in your project root:R2_ACCESS_KEY_ID=your_key R2_SECRET_ACCESS_KEY=your_secret CF_ACCOUNT_ID=your_account
You can also set the environment variables for CI builds.
Note:
You can follow documentation https://developers.cloudflare.com/r2/api/tokens/ for creating API tokens with appropriate permissions for R2 access.
-
-
#951
e3aba83Thanks @vicb! - bump@opennextjs/awsto 3.8.5See details at https://github.com/opennextjs/opennextjs-aws/releases/tag/v3.8.5
-
#948
0c655c3Thanks @vicb! - refactor: do not create a wrangler config when a custom one is passed
-
#945
f73ac0fThanks @vicb! - bump@opennextjs/awsto 3.8.4See details at https://github.com/opennextjs/opennextjs-aws/releases/tag/v3.8.4
-
#937
32ba91aThanks @vicb! - feat: retrieve CLI environment variables fromprocess.envand.env*filesRecommended usage on CI:
- Add your secrets to
process.env(i.e.CF_ACCOUNT_ID) - Add public values to the wrangler config
wrangler.jsonc(i.e.R2_CACHE_PREFIX_ENV_NAME)
Recommended usage for local dev:
- Add your secrets to either a
.dev.vars*or.env*file (i.e.CF_ACCOUNT_ID) - Add public values to the wrangler config
wrangler.jsonc(i.e.R2_CACHE_PREFIX_ENV_NAME)
- Add your secrets to
-
#941
59f52e0Thanks @vicb! - bump@opennextjs/awsto 3.8.2See details at https://github.com/opennextjs/opennextjs-aws/releases/tag/v3.8.2
-
#932
0c7d1aeThanks @vicb! - bump@opennextjs/awsto 3.8.1See details at https://github.com/opennextjs/opennextjs-aws/releases/tag/v3.8.1
-
#918
eeb18bbThanks @vicb! - refactor: account for empty tag list in tag cache -
#921
07487a4Thanks @vicb! - bump@opennextjs/awsto 3.8.0See details at https://github.com/opennextjs/opennextjs-aws/releases/tag/v3.8.0
-
#901
17a4beaThanks @vicb! - chore: bump wrangler to ^4.38.0 -
#903
7fced0fThanks @vicb! - fix: enable using workerd process v2process v2 is an updated version of
node:processactive by default after 2025-09-15
-
#888
51322a8Thanks @james-elicx! - fix: remote flag not working for preview command's cache populationPreviously, passing the
--remoteflag when runningopennextjs-cloudflare preview --remotewould not result in the remote preview binding being populated, and would throw errors due to a missing preview flag when populating Workers KV. The remote flag is now supported for the cache popoulation step when running the preview command.opennextjs-cloudflare preview --remotewill populate the remote binding for the preview ID specified in your Wrangler config.opennextjs-cloudflare previewwill continue to populate the local binding in your Wrangler config.
-
#892
1ee505fThanks @vicb! - Bump @opennextjs/aws to 3.7.7See details at https://github.com/opennextjs/opennextjs-aws/releases/tag/v3.7.7
-
#878
23b67ceThanks @sommeeeer! - fix: Respect trailing slash config for _next/image route in worker -
#882
a6283afThanks @vicb! - perf: skip lazy update on cache hit when cache purge is enabled
- #862
728ad99Thanks @james-elicx! - feat: support for a custom OpenNext config path with the--openNextConfigPathflag
-
#872
dc76d6eThanks @alex-all3dp! - Fix check for missing CACHE_PURGE_ZONE_ID -
#862
728ad99Thanks @james-elicx! - refactor: deprecate usage of the--configPathflag for the Wrangler config, in favour of the--configflag.
-
#865
f1e9457Thanks @sommeeeer! - fix: Ensure request.url reflects the actual host protocol in route handlers -
#867
2c1de0bThanks @vicb! - Log cache purge errors as errors
-
#848
f80c801Thanks @sommeeeer! - Ensure that the initial request.signal is passed to the wrapperrequest.signal.onabortis now supported in route handlers. It requires that the signal from the original worker's request is passed to the handler. It will then pass along thatAbortSignalthrough thestreamCreatorin the wrapper. This signal will destroy the response sent to NextServer when a client aborts, thus triggering the signal in the route handler.See the changelog in Cloudflare here.
Note: If you have a custom worker, you must update your code to pass the original
request.signalto the handler. You also need to enable the compatibility flagenable_request_signalto use this feature.For example:
// Before: return handler(reqOrResp, env, ctx); // After: return handler(reqOrResp, env, ctx, request.signal);
-
#850
ce5c7b4Thanks @dario-piotrowicz! - Add option for regional cache to skip tagCache on cache hitsWhen the tag regional cache finds a value in the incremental cache, checking such value in the tagCache can be skipped, this helps reducing response times at the tradeoff that the user needs to either use the automatic cache purging or manually purge the cache when appropriate. For this the
bypassTagCacheOnCacheHitoption is being added to theRegionalCacheclass.Example:
import { defineCloudflareConfig } from "@opennextjs/cloudflare"; import d1NextTagCache from "@opennextjs/cloudflare/overrides/tag-cache/d1-next-tag-cache"; import memoryQueue from "@opennextjs/cloudflare/overrides/queue/memory-queue"; import r2IncrementalCache from "@opennextjs/cloudflare/overrides/incremental-cache/r2-incremental-cache"; import { withRegionalCache } from "@opennextjs/cloudflare/overrides/incremental-cache/regional-cache"; export default defineCloudflareConfig({ incrementalCache: withRegionalCache(r2IncrementalCache, { mode: "long-lived", bypassTagCacheOnCacheHit: true, }), tagCache: d1NextTagCache, queue: memoryQueue, });
-
#858
7233c03Thanks @vicb! - bump @opennextjs/aws to 3.7.6See the changes at https://github.com/opennextjs/opennextjs-aws/compare/v3.7.4...v3.7.6
-
#857
b8b38eeThanks @vicb! - Clean output directory beforenext build
-
#838
90f451dThanks @conico974! - bump @opennextjs/aws to 3.7.4See details at https://github.com/opennextjs/opennextjs-aws/releases/tag/v3.7.4
-
#833
c9705e5Thanks @sommeeeer! - Update the patches to support Next.js 15.4"
-
#828
d00b3a1Thanks @vicb! - bump @opennextjs/aws to 3.7.2See details at https://github.com/opennextjs/opennextjs-aws/releases/tag/v3.7.2
-
#830
daf36faThanks @vicb! - detect more image typesSync of vercel/next.js#82118
-
#832
67e71b9Thanks @vicb! - fix: --noMinify stop minifying the bundle
-
#820
c202302Thanks @conico974! - Fix regional cache for the DOShardedTagCache -
#818
be6a492Thanks @dario-piotrowicz! - fixdeployanduploadcommands not taking into account environment variables -
#825
3de7962Thanks @conico974! - Add an option to persist missing tags in the regional tag cache -
#816
c46eeeeThanks @vicb! - bump @opennextjs/aws to 3.7.1See details at https://github.com/opennextjs/opennextjs-aws/releases/tag/v3.7.1
- #814
89ce96bThanks @james-elicx! - fix: wrangler config not passed to cache population
- #791
b158e8bThanks @james-elicx! - refactor: use yargs for the cli
- #804
72d8d5bThanks @alex-all3dp! - Fix missing SQL parameter bindings in D1NextModeTagCache.getLastRevalidated()
-
#785
e0f39b6Thanks @vicb! - Cancel the unused stream (body) -
#789
040731cThanks @vicb! - cancel the body stream when unconsumed -
#795
d18cd9dThanks @sommeeeer! - fix(patches): Update patchInstrumentation and loadManifest to work with Next 15.4 -
#800
a3e7551Thanks @vicb! - wrangler should not load .env files
-
#781
e984e8fThanks @vicb! - fallback to the upstream image content-type header -
#779
224a2f0Thanks @petebacondarwin! - Ensure that thecloudflarelibrary is available at runtimePreviously it was only a
devDependencywhich meant it was missing in real life installations of the tool.The error looked like:
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'cloudflare' imported from @opennextjs/cloudflare/dist/cli/commands/skew-protection.js
-
#768
40f7e72Thanks @vicb! - Add an asset resolver to supportrun_worker_first=true -
#746
6d020feThanks @vicb! - feat: add support for experimental skew protection
-
#738
b911c3eThanks @sommeeeer! - fix: support Next 14 experimental.serverComponentsExternalPackages -
#740
d8150d2Thanks @sommeeeer! - feat(images): implement localPatterns for images -
#720
9ed8d8aThanks @james-elicx! - feat: pass cli arguments not used byopennextjs-cloudflareto wranglerPreviously, arguments had to be provided after
--e.g.opennextjs-cloudflare preview -- --port 12345. This is no longer necessary, and they can be provided normally, e.g.opennextjs-cloudflare preview --port 12345. -
#743
7a2fc7dThanks @vicb! - update @opennextjs/aws to 3.6.6 -
#712
2f6dd81Thanks @vicb! - Drop the patch for NextServer#getMiddlewareManifest (taken care of by was)
-
#714
eedbe2bThanks @vicb! - perf: minify the generated bundle by default -
#713
3d8fb0cThanks @vicb! - make the "require" patch optional
-
#696
de6a6cdThanks @vicb! - Add theroutePreloadingBehaviorto the options ofdefineCloudflareConfig.The default is set to "none" as other values might increase CPU usage on cold starts.
-
#700
56e9366Thanks @vicb! - perf: drop@ampproject/toolbox-optimizerto reduce the server bundle size -
#689
64a10a6Thanks @sommeeeer! - fix: Ensure the protocol is correct for redirects in server actions during preview mode -
#710
903ad45Thanks @vicb! - perf: drop babel to reduce the server bundle size
-
#655
2c819c6Thanks @conico974! - Automatic Cache API purge -
#500
5142788Thanks @conico974! - add regional replicas for the sharded tag cache -
#496
298fd4eThanks @conico974! - add an optional cache for the durable queue
-
#675
e6040bcThanks @conico974! - add acloudflare.dangerousDisableConfigValidationconfig option to not throw on validation of the config -
#674
ec9ea58Thanks @conico974! - fix blockConcurrencyWhile on DO queue -
#672
9188e67Thanks @conico974! - bump aws to 3.6.2. More details about the fixes can be found here: https://github.com/opennextjs/opennextjs-aws/blob/main/packages/open-next/CHANGELOG.md#362
-
#666
e87d8bbThanks @conico974! - fix fetch insideuse cachein ISR -
#599
7b06a42Thanks @james-elicx! - Fix multiple Windows path issues.
-
#656
a20d2dfThanks @conico974! - revert to using an external middlewareThis will reduce cpu time for anything coming from the routing layer (i.e. redirects, rewrites, middleware response or when using cache interception)
- #648
cb3a2f2Thanks @conico974! - fix cache population hanging
-
#613
2d82fadThanks @conico974! - Bump aws to 3.6.0Introduce support for the composable cache
BREAKING CHANGE: The interface for the Incremental cache has changed. The new interface use a Cache type instead of a boolean to distinguish between the different types of caches. It also includes a new Cache type for the composable cache. The new interface is as follows:
export type CacheEntryType = "cache" | "fetch" | "composable"; export type IncrementalCache = { get<CacheType extends CacheEntryType = "cache">( key: string, cacheType?: CacheType ): Promise<WithLastModified<CacheValue<CacheType>> | null>; set<CacheType extends CacheEntryType = "cache">( key: string, value: CacheValue<CacheType>, isFetch?: CacheType ): Promise<void>; delete(key: string): Promise<void>; name: string; };
NextModeTagCache also get a new function
getLastRevalidatedused for the composable cache:getLastRevalidated(tags: string[]): Promise<number>;
-
#640
af60deaThanks @vicb! - fix: escape shell arguments when populating the cache -
#628
a169b76Thanks @conico974! - fix issues with build conditions and wasm -
#619
09aaf35Thanks @conico974! - global timer functions now use the one from node:timers -
#593
faca3e1Thanks @vicb! - Use the workerd build condition by default -
#641
e07a2edThanks @conico974! - some performance improvementsenableCacheInterceptioncan be enabled usingdefineCloudflareConfig, it loads ISR/SSG pages from cache without waiting for the js page bundle to load. PPR is not supported at the momentroutePreloadingBehavioris now set towithWaitUntil, which means a single route js will be lazy loaded on cold start, but other routes will be preloaded usingwaitUntilfor better performance
-
#639
c4d278eThanks @conico974! - polyfill import.meta.url -
#622
f5264d2Thanks @james-elicx! - feat: usegetPlatformProxyfor cache population prefix vars -
#616
f129602Thanks @james-elicx! - feat: prefix for kv cache keys -
#644
899bae0Thanks @conico974! - fix cache population for R2 -
#626
de9e05aThanks @james-elicx! - feat: bulk insert cache entries to KV
-
#608
055a61bThanks @conico974! - Add a newwithFiltertag cache to allow to filter the tags used -
#591
0361672Thanks @vicb! - Add an example of creating a custom workerCreating a custom worker enable adding DO, handlers (scheduled, queue, ...)
closes #207, #397, #589
-
#607
15f1160Thanks @conico974! - fix page router shared context to use the correct one
-
#581
c7c5d3dThanks @vicb! - fix(tagCache): gracefully handle empty tag list -
#563
2ce6454Thanks @vicb! - Extract the worker init code to a separate file -
#551
8841641Thanks @SamyPesse! - SetCache-Tagon the entries created by the regional cache, to be purged using the Cloudflare API or dashboard. -
#579
68d6bb4Thanks @vicb! -patchNextMinimalis no more required with the latest@opennextjs/awsbump -
#559
b002d80Thanks @james-elicx! - feat:uploadcommand for worker versions' -
#564
6343fb4Thanks @conico974! - bump @opennextjs/aws to 3.5.6
-
#546
9adc3a3Thanks @james-elicx! - feat: populate kv incremental cache -
#547
25ade6fThanks @james-elicx! - feat: static assets incremental cache
-
#526
8b40268Thanks @vicb! - Prepare for release 1.0.0-beta.0Bump
@opennextjs/awsto 3.5.4BREAKING CHANGES
DurableObjectQueueHandlerrenamed toDOQueueHandlerNEXT_CACHE_DO_QUEUE_MAX_NUM_REVALIDATIONSrenamed toNEXT_CACHE_DO_QUEUE_MAX_RETRIESD1TagCachehas been removed, useD1NextModeTagCacheinstead.- The
enableShardReplicationandshardReplicationOptionsoptions passed toShardedDOTagCachehave been folded intoshardReplication. A value forshardReplicationmust be specified to enable replications. The value must be an object with the number of soft and hard replicas.
-
#520
3bd200aThanks @vicb! - Defineprocess.versionandprocess.versions.node -
#522
79fadc4Thanks @vicb! - Log exceptions inrequirePageandNodeModuleLoaderwhenOPEN_NEXT_DEBUG=1 -
#523
19dedc7Thanks @vicb! - fix: process.env has a higher loading priority than .env files -
#469
aef8e51Thanks @Juuldamen! - Adds support for passing options toinitOpenNextCloudflareForDev(). This allows you to configure how your Cloudflare bindings will behave during local development.For example, the below configuration will persist the local state of bindings to a custom directory. Which can be useful if you want to share the state between different apps that reuse the same bindings in a monorepo.
initOpenNextCloudflareForDev({ persist: { path: "../../.wrangler/state/v3/custom-dir", }, });
You can find the configuration type with it's available options here in the Wrangler source code.
- #512
96efdc1Thanks @james-elicx! - fix: yarn v4 not passing args to wrangler correctly
- #509
42e2b5cThanks @ItsWendell! - fix: nextjs handler not detected in worker
- #505
ce7516dThanks @james-elicx! - fix: npm failing to pass args to wrangler
- #503
ba35663Thanks @james-elicx! - fix: bun failing to spawn wrangler
-
#499
5037f57Thanks @vicb! - Refactor the codebase for consistencyBREAKING CHANGE
Overrides:
Overrides now live in
@opennextjs/cloudflare/overridesand some files have been renamed.- Incremental cache overrides:
@opennextjs/cloudflare/overrides/incremental-cache/... - Tag cache overrides:
@opennextjs/cloudflare/overrides/tag-cache/... - Queue overrides:
@opennextjs/cloudflare/overrides/queue/...
For example the KV incremental cache override can be imported as
@opennextjs/cloudflare/overrides/incremental-cache/kv-incremental-cache.Environment variables and bindings name changes:
NEXT_CACHE_WORKERS_KV->NEXT_INC_CACHE_KVNEXT_CACHE_R2_...->NEXT_INC_CACHE_R2_...NEXT_CACHE_D1->NEXT_TAG_CACHE_D1NEXT_CACHE_DO_...->NEXT_TAG_CACHE_DO_...NEXT_CACHE_DO_REVALIDATION->NEXT_CACHE_DO_QUEUENEXT_CACHE_REVALIDATION_WORKER->WORKER_SELF_REFERENCE
Other:
NEXT_CACHE_D1_TAGS_TABLEandNEXT_CACHE_D1_REVALIDATIONS_TABLEhave been dropped. The tables have a fixed namestagsandrevalidations. - Incremental cache overrides:
-
#479
0c93e8bThanks @james-elicx! - feat: commands for cli actionsThe OpenNext Cloudflare CLI now uses the following commands;
build: build the applicationpopulateCache: populate either the local or remote cachepreview: populate the local cache and start a dev serverdeploy: populate the remote cache and deploy to production
-
#490
00f6071Thanks @vicb! - Drop the deprecated kvCache in favor of kv-cache
-
#487
0702d2eThanks @james-elicx! - feat: support passing the wrangler environment when populating the cache -
#480
e0ec01dThanks @conico974! - fix deduplication for memory queue and add some log -
#481
9b0db4dThanks @conico974! - fixres.revalidatenot working in page router api route -
#484
6ce5643Thanks @conico974! - Add sharding replication for the Durable Object Tag Cache -
#470
2650043Thanks @conico974! - feat: add a sharded SQLite Durable object implementation for the tag cache -
#485
ced7d46Thanks @conico974! - add an option for disabling sqlite on the durable object queue -
#460
60171f5Thanks @conico974! - feat: durable object de-duping revalidation queue -
#436
86c0139Thanks @james-elicx! - feat: auto-populating d1 cache data -
#464
acfc7f3Thanks @conico974! - Implement next mode for d1 tag cache that will reduce write -
#486
25a8f4cThanks @conico974! - auto create table for D1NextModeTagCache -
#443
54508ffThanks @james-elicx! - feat: r2 adapter for the incremental cache -
#491
e9dc621Thanks @vicb! - Serve/cdn-cgi/image/...images in dev
-
#455
1d40ab1Thanks @vicb! - sync with@opennextjs/aws@3.5.2 -
#453
95caa87Thanks @vicb! - fix: Pages router API routes with Next 14 -
#452
161a5f7Thanks @vicb! - fix: patch the webpack runtime when there is a single chunk
-
#445
6a389feThanks @james-elicx! - fix: deployed worker unable to invoke itself in memory queueIn deployments, Cloudflare Workers are unable to invoke workers on the same account via fetch, and the recommended way to call a worker is to use a service binding. This change switches to use service bindings for the memory queue to avoid issues with worker-to-worker subrequests.
To continue using the memory queue, add a service binding to your wrangler config for the binding
NEXT_CACHE_REVALIDATION_WORKER.{ "services": [ { "binding": "NEXT_CACHE_REVALIDATION_WORKER", "service": "<WORKER_NAME>" } ] }
- #441
4966779Thanks @conico974! - Fix forInvariant: renderHTML should not be called in minimal mode
-
#431
9ad6714Thanks @HyperKiko! - fix pages api routesfixed pages api routes by inlining a dynamic require in the
NodeModuleLoaderclass
-
#412
58b200fThanks @dario-piotrowicz! - adddefineCloudflareConfigutilitythis change adds a new
defineCloudflareConfigutility that developers can use in theiropen-next.config.tsfile to easily generate a configuration compatible with the adapterExample usage:
// open-next.config.ts import { defineCloudflareConfig } from "@opennextjs/cloudflare"; import kvIncrementalCache from "@opennextjs/cloudflare/kv-cache"; export default defineCloudflareConfig({ incrementalCache: kvIncrementalCache, });
-
#413
01e2bfbThanks @ha1fstack! - improve windows support
-
#320
ff2dd55Thanks @james-elicx! - feat: d1 adapter for the tag cache -
#409
a604c85Thanks @dario-piotrowicz! - make sure that instrumentation files workcurrently instrumentation files in applications built using the adapter are ignored, the changes here make sure that those are instead properly included in the applications
-
#410
d30424bThanks @dario-piotrowicz! - removeevalcalls introduced bydepdwrapped functionsSome dependencies of Next.js (
raw-bodyandsend) usedepdto deprecate some of their functions,depdusesevalto generate a deprecated version of such functions, this causesevalwarnings in the terminal even if these functions are never called, the changes here by patching the depdwrapfunctionfunction so that it still retains the same type of behavior but without usingeval -
#404
12d385dThanks @dario-piotrowicz! - fix incorrect (sync)getCloudflareContexterror messagecurrently
getCloudflareContextrun in sync mode at the top level of a not static route gives a misleading error message saying that the function needs to be run in a not static route, the changes here correct this error message clarifying that the problem actually is
-
#372
522076bThanks @dario-piotrowicz! - add "async mode" togetCloudflareContextAdd an
asyncoption togetCloudflareContext({async})to run it in "async mode", the difference being that the returned value is a promise of the Cloudflare context instead of the context itselfThe main of this is that it allows the function to also run during SSG (since the missing context can be created on demand).
-
ad895ed: fix: vercel og patch not moving to right node_modules directory
There are two separate places where the node_modules could be. One is a package-scoped node_modules which does not always exist - if it doesn't exist, the server functions-scoped node_modules is used.
- 82bb588: feat: basic in-memory de-duping revalidation queue
-
2e48d4f: fix: make sure that fetch cache
sets are properly awaitedNext.js does not await promises that update the incremental cache for fetch requests, that is needed in our runtime otherwise the cache updates get lost, so this change makes sure that the promise is properly awaited via
waitUntil -
0c26049: fix path to file template in
open-next.config.ts.
-
ac8b271: fix waitUntil
Calling
waitUntil/afterwas failing when mulitple requests were handled concurrently. This is fixed by pulling opennextjs/opennextjs-aws#733 -
761a312: import
randomUUIDfromnode:cryptoto support NodeJS 18
-
420b598: Fix asset cache path
-
a19b34d: perf: reduce CPU and memory usage by limiting code to AST parsing
-
f30a5fe: bump
@opennextjs/awsdependency tohttps://pkg.pr.new/@opennextjs/aws@727 -
6791cea: Use kebab-case for the KV Cache.
-
a630aea: fix: enable using the
directqueue for isrThe
directmode is not recommended for use in production as it does not de-dupe requests. -
f30a5fe: Fix: make sure that the kvCache doesn't serve stale cache values from assets when there is no KV binding
-
9561277: fix: remove dynamic require for map file
ESBuild tries to load all files in the chunks folder with
require("./chunks/" + var). This is an error when the folder contains map file.
-
1ccff65: bump
@opennextjs/awsdependency tohttps://pkg.pr.new/@opennextjs/aws@724this bump fixes rewrites to external urls not working when the external urls point to resources hosted on the Cloudflare network
-
30374b9: fix: Drop the module condition from ESBuild
Because Next (via nft) does not use the module condition, ESBuild should not use it. Otherwise we might end up with missing files and a broken build.
-
6103547: fix: provide a proper error message when using
getCloudflareContextin static routesgetCloudflareContextcan't be used in static routes, currently a misleading error message incorrectly tells the developer that they haven't calledinitOpenNextCloudflareForDevin their config file, this change updates such error message to properly clarify what the issue is (and how to solve it) -
0a6191d: fix the encoding of __NEXT_PRIVATE_STANDALONE_CONFIG
-
da7f8d8: fix: enable PPR with
wrangler dev -
714172d: fix: trailing slash redirect
-
0892679: fix: inline optional dependencies when bundling the server
-
9d45ee8: fix the error message of getCloudflareContext
Hardcode function names that would get mangled otherwise.
-
ac52954: bump the
wranglerpeer dependency (so to avoid multipleUsing vars defined in .dev.varslogs during local development)
-
1b3a972: Dump ESBuild metadata to
handler.mjs.meta.jsonThe ESBuild metadata are written to a file alongside
handler.mjsin.open-next/server-functions/default/... -
5c90521: refactor: Make the list of optional dependencies configurable
-
67acb2f: fix build issues with
@opentelemetryBy using the pre-compiled library provided by Next.
-
3ed6cd1: fix: syntax error
-
1a2b815: fix: make sure that the
initOpenNextCloudflareForDev()logic runs only onceCurrently calling
initOpenNextCloudflareForDev()in the Next.js config file causes this initialization logic to run twice, consuming more resources and causing extra noise in the terminal logs, this change makes sure that the initialization logic is run only once instead
-
8de2c04: introduce new
initOpenNextCloudflareForDevutility and makegetCloudflareContextsynchronousthis change introduces a new
initOpenNextCloudflareForDevfunction that must called in the Next.js config file to integrate the Next.js dev server with the open-next Cloudflare adapter.Also makes
getCloudflareContextsynchronous.Additionally the
getCloudflareContextcan now work during local development (next dev) in the edge runtime (including middlewares).Moving forward we'll recommend that all applications include the use of the
initOpenNextCloudflareForDevutility in their config file (there is no downside in doing so and it only effect local development).Example:
// next.config.mjs import { initOpenNextCloudflareForDev } from "@opennextjs/cloudflare"; initOpenNextCloudflareForDev(); /** @type {import('next').NextConfig} */ const nextConfig = {}; export default nextConfig;
-
4ec334a: fix: @vercel/og failing due to using the node version.
Patches usage of the @vercel/og library to require the edge runtime version, and enables importing of the fallback font.
-
48f863f: fix: do not require
caniuse-litecaniuse-liteis an optional dependency. -
27ab1ab: refactor: use the new regex utility for constructing cross-platform paths
- 67fafeb: fix top level awaits not working in middlewares by bumping the
@opennextjs/awspackage
- 05ee8d4: fix: invalid paths in windows bundles.
- 41c55a8: Add support for specifying wrangler environment when using next dev so that bindings and vars are properly loaded. This can be specified with the env variable NEXT_DEV_WRANGLER_ENV.
- 2e13de2: fix broken
patchRequireReactDomServerEdgepatch
-
9ab86d4: fix: host not included in route handler urls
Next.js was unable to re-construct the correct URLs for the request in a route handler due to being unable to retrieve the hostname. This was due to the internal Next.js option
trustHostHeaderbeing disabled in OpenNext when there is external middleware - this option is needed for the Next.js server in our environment.
- 77e31d5: update the
patchExceptionBubblingpatch - dbcc4be: patch
require("react-dom/server.edge")calls inpages.runtime.prod.jsso that they aretry-catched - 632a7d7: show error on Next.js versions older than v14
-
d488d86: fix: exclude
.env.localfiles fortestmodeAligns with the Next.js behavior of not extracting variables from the
.env.localfile in test environments. -
0ee77b2: fix the city header encoding
By pulling opennextjs/opennextjs-aws#688
-
4b6a50b: check and create a
wrangler.jsonfile for the user in case awrangler.(toml|json|jsonc)file is not already presentalso introduce a new
--skipWranglerConfigCheckcli flag and aSKIP_WRANGLER_CONFIG_CHECKenvironment variable that allows users to opt out of the above check (since developers might want to use custom locations for their config files) -
7654867: bump
"@opennextjs/awsdependency tohttps://pkg.pr.new/@opennextjs/aws@686
-
b3949ce: fix: delete init.cache rather than assign undefined
Assigning undefined to init.cache throws when using NextAuth
-
12a1f75: update location of output path in success message
-
c0c1d04: fix: CustomRequest instantiation
In some cases some request properties would not be initialized (i.e. method, headers, ...) The bug was caused by the processing the init in the CustomRequest class. The bug was tigerred when using clerk.
- f60a326: fix: cleanup dependencies
-
ca2d452: feat: rename the binary from "cloudflare" to "opennextjs-cloudflare"
BREAKING CHANGE: After this change the old way of running the tool (e.g.
pnpm cloudflare) no longer works. Going forward use the new binary name (e.g.pnpm opennextjs-cloudflare).See #161
-
Add support for middleware, loading
.env*files, ...
-
5bceecc: example: Add vercel blog starter
Update the examples with vercel blog starter and adapt it to run on cf workers
-
6acf0fd: feat: cli arg to disable minification
The cache handler currently forces minification. There is now a CLI arg to disable minification for the build. At the moment, this only applies to the cache handler but may be used for other parts of the build in the future when minification is introduced to them. By default, minification is enabled, but can be disabled by passing
--noMinify.
-
66ba0ff: enhancement: Expand missing next.config error message
Found out that next dev can run the a Next.js app without next.config but if we are using the adapter we throw an error if we don't find the config. So expanded the error for users.
-
87f4fb5: feat: configure kv binding name with env var
The Workers KV binding used in the Next.js cache handler can be given a custom name with the
__OPENNEXT_KV_BINDING_NAMEenvironment variable at build-time, instead of defaulting toNEXT_CACHE_WORKERS_KV.
-
83abcfe: refactor: retrieve cache handler kv instance inside constructor
The cache handler was retrieving it's KV instance as a static property on the class that was defined at some point during the execution of the Next.js server. This moves the retrieval of the KV instance to happen inside the constructor for the class, so that it is retrieved during instantiation instead.
- a99cd1e: ci: actually publish updates packages to npm
- ce8a281: ci: first deployment via changesets