Skip to content

fix(nextjs): drop invalid comparator from strictly-safe version range - #677

Merged
leoortizz merged 1 commit into
mainfrom
fix/nextjs-safe-version-range
Aug 11, 2026
Merged

fix(nextjs): drop invalid comparator from strictly-safe version range#677
leoortizz merged 1 commit into
mainfrom
fix/nextjs-safe-version-range

Conversation

@leoortizz

Copy link
Copy Markdown
Member

Test Node 18 fails on main, skipping Publish (NPM) and blocking releases: https://github.com/firebase/apphosting-adapters/actions/runs/31520664730/job/93877364944#step:8:165

STRICTLY_SAFE_NEXTJS_VERSIONS starts with ==16.1.0, which isn't valid semver — new Range("==16.1.0") throws Invalid comparator. One bad comparator invalidates the whole range, so satisfies() always returned false and the prerelease fallback from #665 never matched. Every prerelease was blocked.

Dropping the clause is enough; >=16.1.1 already covers it. Repairing it to =16.1.0 would instead allow 16.1.0-canary.1, which predates the fix released in 16.1.0.

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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the STRICTLY_SAFE_NEXTJS_VERSIONS constant in packages/@apphosting/adapter-nextjs/src/utils.ts to exclude version 16.1.0 from the strictly safe range, now requiring >=16.1.1. There are no review comments, and I have no feedback to provide.

@leoortizz
leoortizz merged commit da0a598 into main Aug 11, 2026
26 of 27 checks passed
@leoortizz
leoortizz deleted the fix/nextjs-safe-version-range branch August 11, 2026 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants