Skip to content

fix: version gate for next-runtime - #1498

Merged
hrishikesh-k merged 3 commits into
mainfrom
hk/next-runtime-version-gate
Aug 11, 2026
Merged

fix: version gate for next-runtime#1498
hrishikesh-k merged 3 commits into
mainfrom
hk/next-runtime-version-gate

Conversation

@hrishikesh-k

@hrishikesh-k hrishikesh-k commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Fixes https://linear.app/netlify/issue/FRB-2325/

In the current array, Next.js Runtime v4 was the ultimate fallback as it had no version constraints. For new Next.js sites where we fail to detect the Next.js version by any chance, we end up falling back to v4 of Next.js Runtime due to this. With the new version gate, we should now be able to get the latest version as the fallback as new sites would mostly use a recent version of Next.js.

This would now create a problem for these situations:

  • An existing site (built on Next 13.5–13.9 years ago) that's only now adding @netlify/plugin-nextjs to its config for the first time, or migrating onto Netlify.
  • A site that's had the plugin config removed/changed and is re-resolving from scratch.
  • Any site whose pin record didn't get set for some other reason (failed prior runs, manual config changes, etc.).

That is, sites using Next.js 13.5-13.9 and Node.js < 18 will now be forced to use Next.js Runtime v5 which doesn't support Node < 18. I do not think this would be a real use-case though.

Also fixed the ordering as <10.0.6 is also <10.0.9, so v1 would never match unless it's pinned. This should not be relevant anymore though.

@hrishikesh-k
hrishikesh-k requested a review from a team as a code owner August 11, 2026 09:06
@netlify

netlify Bot commented Aug 11, 2026

Copy link
Copy Markdown

Deploy Preview for netlify-plugins ready!

Name Link
🔨 Latest commit 711e276
🔍 Latest deploy log https://app.netlify.com/projects/netlify-plugins/deploys/6a7aeaf2bf394200084791d8
😎 Deploy Preview https://deploy-preview-1498--netlify-plugins.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • Documentation
    • Updated the Next.js plugin repository link to the OpenNext.js repository.
    • Added migration guidance for plugin version 4.41.6.
    • Clarified that version 4.41.6 applies to Next.js versions below 13.5.0.
    • Corrected version 3.9.2 compatibility requirements to Next.js 10.0.6 through versions below 10.0.9.
    • Reordered compatibility entries for improved clarity.

Walkthrough

The Next.js plugin repository URL now points to OpenNext.js. Compatibility metadata adds a migration guide and a next <13.5.0 constraint for version 4.41.6. Version 3.9.2 now requires next >=10.0.6 <10.0.9.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested reviewers: pieh

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: fixing the Next.js runtime version gate.
Description check ✅ Passed The description explains the runtime fallback changes, version-gate ordering fix, and known compatibility impact.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch hk/next-runtime-version-gate

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@site/plugins.json`:
- Around line 644-655: Reorder the adjacent plugin entries in siteDependencies
so version 3.9.2 appears before version 1.1.5, preserving each entry’s existing
next compatibility range and all other content.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a172ffff-1127-4220-a271-9da9dd5a4043

📥 Commits

Reviewing files that changed from the base of the PR and between 787cf88 and 45e21dc.

📒 Files selected for processing (1)
  • site/plugins.json
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • netlify/blueprints (manual)

Comment thread site/plugins.json Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
site/plugins.json (1)

640-642: 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

Prevent the no-match fallback from selecting Runtime v5 for Node.js below 18.

When Next.js is 13.5.0 or newer and Node.js is 16 or 17, no compatibility entry matches. The resolver then falls back to the first entry, 5.7.0-ipx.0, which requires Node.js 18 or newer. Return no compatible runtime or add an explicit Node.js-below-18 entry. Add boundary tests for Next.js 13.5.0, 13.9.x, and 14.0.0 with Node.js 16, 17, and 18.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@site/plugins.json` around lines 640 - 642, Update the runtime compatibility
configuration and resolver so Next.js 13.5.0 or newer with Node.js 16 or 17 does
not fall through to the first Runtime v5 entry; return no compatible runtime or
add an explicit below-18 compatibility entry. Preserve Runtime v5 selection for
supported Node.js versions, and add boundary coverage for Next.js 13.5.0,
13.9.x, and 14.0.0 across Node.js 16, 17, and 18.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@site/plugins.json`:
- Around line 640-642: Update the runtime compatibility configuration and
resolver so Next.js 13.5.0 or newer with Node.js 16 or 17 does not fall through
to the first Runtime v5 entry; return no compatible runtime or add an explicit
below-18 compatibility entry. Preserve Runtime v5 selection for supported
Node.js versions, and add boundary coverage for Next.js 13.5.0, 13.9.x, and
14.0.0 across Node.js 16, 17, and 18.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 956841e5-b763-4f6f-ab7d-afc4d3196797

📥 Commits

Reviewing files that changed from the base of the PR and between 45e21dc and 711e276.

📒 Files selected for processing (1)
  • site/plugins.json
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • netlify/blueprints (manual)

@hrishikesh-k
hrishikesh-k merged commit 80caa49 into main Aug 11, 2026
7 checks passed
@hrishikesh-k
hrishikesh-k deleted the hk/next-runtime-version-gate branch August 11, 2026 10:25
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