Skip to content

fix: downgrade Next.js to 16.1.5 for OpenNext compatibility#105

Merged
icanvardar merged 1 commit intomainfrom
canary
Mar 23, 2026
Merged

fix: downgrade Next.js to 16.1.5 for OpenNext compatibility#105
icanvardar merged 1 commit intomainfrom
canary

Conversation

@icanvardar
Copy link
Member

@icanvardar icanvardar commented Mar 23, 2026

Summary

  • Next.js 16.2.0 crashes on Cloudflare Workers: Unexpected loadManifest(/.next/server/prefetch-hints.json) call!
  • This is a known incompatibility between Next.js 16.2 and @opennextjs/cloudflare@1.17.1 (fix merged but unreleased)
  • Downgrade to Next.js 16.1.5 which is the latest version supported by OpenNext
  • Can upgrade back when @opennextjs/cloudflare releases a version with the fix

Open with Devin

Next.js 16.2.0 introduced prefetch-hints.json which crashes on
Cloudflare Workers with @opennextjs/cloudflare@1.17.1. The fix
(opennextjs/opennextjs-cloudflare#1151) is merged but not yet
released to npm.
@icanvardar icanvardar merged commit 914e48e into main Mar 23, 2026
2 checks passed
@greptile-apps
Copy link

greptile-apps bot commented Mar 23, 2026

Greptile Summary

This PR performs a targeted Next.js downgrade from ^16.2.0 to the exact-pinned 16.1.5 to work around a known crash (Unexpected loadManifest(/.next/server/prefetch-hints.json) call!) when deploying to Cloudflare Workers via @opennextjs/cloudflare@1.17.1. The corresponding bun.lock is fully regenerated to match.

Key changes:

  • next version changed from the loose ^16.2.0 range to the exact pin 16.1.5, which correctly prevents any future automatic upgrade that would re-introduce the incompatibility.
  • All @next/swc-* platform binaries and @next/env in bun.lock are updated consistently to 16.1.5.
  • Minor transitive dependency adjustments (baseline-browser-mapping ^2.9.19^2.8.3, sharp ^0.34.5^0.34.4) reflect what 16.1.5 actually requires and are correct.
  • @opennextjs/cloudflare remains at ^1.17.1; once a patched release is published the team intends to re-upgrade Next.js, which will require a deliberate version bump — the exact pin makes that intent clear.

Confidence Score: 5/5

  • This PR is safe to merge — it is a minimal, well-scoped dependency pin with no logic changes.
  • The change is a single-line version bump in package.json plus the corresponding lock-file regeneration. The root cause (Next.js 16.2.0 / OpenNext incompatibility) is a documented upstream issue; the fix (pin to 16.1.5) is the recommended workaround. No application code is touched, and all lock-file entries are internally consistent. Exact pinning also guards against accidental re-upgrade.
  • No files require special attention.

Important Files Changed

Filename Overview
apps/web/package.json Downgrades Next.js from ^16.2.0 (caret range) to exact-pinned 16.1.5 to avoid OpenNext Cloudflare crash; pin prevents future accidental upgrades that would reintroduce the incompatibility.
bun.lock Lock file correctly regenerated: all @next/* SWC platform binaries and @next/env downgraded from 16.2.0 to 16.1.5, baseline-browser-mapping peer updated from ^2.9.19 to ^2.8.3, and sharp optional dep from ^0.34.5 to ^0.34.4, consistent with the new Next.js release.

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant Next as Next.js
    participant OpenNext as @opennextjs/cloudflare
    participant CF as Cloudflare Workers

    Dev->>Next: Build (16.2.0)
    Next-->>OpenNext: loadManifest(prefetch-hints.json)
    OpenNext-->>CF: ❌ Crash: Unexpected loadManifest call

    Note over Next,OpenNext: Downgrade Next.js to 16.1.5

    Dev->>Next: Build (16.1.5)
    Next-->>OpenNext: Compatible build output
    OpenNext-->>CF: ✅ Deploy succeeds
Loading

Reviews (1): Last reviewed commit: "fix: downgrade Next.js to 16.1.5 for Ope..." | Re-trigger Greptile

Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

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.

1 participant