fix: version gate for next-runtime - #1498
Conversation
✅ Deploy Preview for netlify-plugins ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe Next.js plugin repository URL now points to OpenNext.js. Compatibility metadata adds a migration guide and a Estimated code review effort: 1 (Trivial) | ~2 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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
📒 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)
There was a problem hiding this comment.
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 liftPrevent 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
📒 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)
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:
@netlify/plugin-nextjsto its config for the first time, or migrating onto Netlify.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.6is also<10.0.9, so v1 would never match unless it's pinned. This should not be relevant anymore though.