From 55b5d75f3f9e3af33b1fd76c8dbf640c8e018ad0 Mon Sep 17 00:00:00 2001 From: Leonardo Ortiz Date: Tue, 11 Aug 2026 15:32:43 -0300 Subject: [PATCH] fix(nextjs): drop invalid comparator from strictly-safe version range MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit STRICTLY_SAFE_NEXTJS_VERSIONS began with "==16.1.0", which is not valid semver range syntax — `new Range("==16.1.0")` throws `Invalid comparator`. A single bad comparator invalidates the entire range, so satisfies(base, STRICTLY_SAFE_NEXTJS_VERSIONS) always returned false and the prerelease fallback added in #665 never matched anything. Every prerelease was blocked, and the unit test for 16.3.0-preview failed. Removing the clause is enough: ">=16.1.1" already covers it. Repairing it to "=16.1.0" instead would allow 16.1.0-canary.1, a build that predates the fix released in 16.1.0 — the +1 patch offset in each clause of this range exists precisely because a prerelease sorts before its own release. --- packages/@apphosting/adapter-nextjs/src/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@apphosting/adapter-nextjs/src/utils.ts b/packages/@apphosting/adapter-nextjs/src/utils.ts index 787dbcbe3..781e39b3f 100644 --- a/packages/@apphosting/adapter-nextjs/src/utils.ts +++ b/packages/@apphosting/adapter-nextjs/src/utils.ts @@ -23,7 +23,7 @@ export const { satisfies } = semVer; const SAFE_NEXTJS_VERSIONS = ">=16.1.0 || ~16.0.7 || ~v15.5.7 || ~v15.4.8 || ~v15.3.6 || ~v15.2.6 || ~v15.1.9 || ~v15.0.5 || <14.3.0-canary.77"; const STRICTLY_SAFE_NEXTJS_VERSIONS = - "==16.1.0 || >=16.1.1 || ~16.0.8 || ~v15.5.8 || ~v15.4.9 || ~v15.3.7 || ~v15.2.7 || ~v15.1.10 || ~v15.0.6 || <14.3.0-canary.77"; + ">=16.1.1 || ~16.0.8 || ~v15.5.8 || ~v15.4.9 || ~v15.3.7 || ~v15.2.7 || ~v15.1.10 || ~v15.0.6 || <14.3.0-canary.77"; export function checkNextJSVersion(version: string | undefined) { if (!version) {