nextjs - ✅(Solved) Fix Next.js 16.2.0 regression: bunVersion ignored, all functions forced to Node.js on Vercel [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#91720Fetched 2026-04-08 01:07:16
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Author
Participants
Timeline (top)
commented ×1cross-referenced ×1issue_type_added ×1labeled ×1

Root Cause

Root cause hypothesis: 16.2.0 graduated adapterPath to stable. Vercel auto-injects NEXT_ADAPTER_PATH for 16.2+ builds, activating nextjs/adapter-vercel. The adapter's onBuildComplete writes .vc-config.json per function with a Node.js runtime hardcoded, overriding the project-level bunVersion.

Fix Action

Fix / Workaround

Workarounds attempted (none worked):

  • experimental: { turbopackInferModuleSideEffects: false } — no effect
  • Setting NEXT_ADAPTER_PATH="" in Vercel env vars — no effect
  • Only downgrading to 16.1.7 restores Bun runtime

Related: #91691 reports a similar Bun regression in 16.2.0 but attributes it to turbopackInferModuleSideEffects. That workaround does not fix this case — the adapter pipeline itself is the issue.

PR fix notes

PR #24: Updated Next.js and ESLint to match versions and fixed other vulnerabilities

Description (problem / solution / changelog)

This pull request updates next and eslint-config-next to match their versions (^16.2.1) and resolves several vulnerabilities identified by npm audit.

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

Summary by CodeRabbit

  • Chores
    • Updated framework version to the latest stable release.
    • Updated development tooling versions for improved compatibility and standards.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Changed files

  • package-lock.json (modified, +983/-4956)
  • package.json (modified, +3/-3)

Code Example

Detected Next.js version: 16.2.0
$ bun --bun next build
Next.js 16.2.0 (Turbopack)
  Creating an optimized production build ...
Compiled successfully in 4.4s
Generating static pages using 1 worker (4/4) in 180ms
  Running onBuildComplete from Vercel              <-- adapter activated
Build Completed in /vercel/output [11s]

---

Detected Next.js version: 16.1.7
$ bun --bun next build
Next.js 16.1.7 (Turbopack)
  Creating an optimized production build ...
Compiled successfully in 5.7s
Generating static pages using 1 worker (4/4) in 172.7ms
Traced Next.js server files in: 35.941ms           <-- old pipeline, no adapter
Created all serverless functions in: 111.373ms
Build Completed in /vercel/output [16s]

---

Operating System:
  Platform: linux
  Arch: x64
  Version: #106-Ubuntu SMP PREEMPT_DYNAMIC Fri Mar  6 07:58:08 UTC 2026
  Available memory (MB): 15993
  Available CPU cores: 4
Binaries:
  Node: 24.3.0
  npm: 11.6.2
  Yarn: N/A
  pnpm: 10.15.0
Relevant Packages:
  next: 16.2.0 // Latest available version is detected (16.2.0).
  eslint-config-next: 16.2.0
  react: 19.2.4
  react-dom: 19.2.4
  typescript: 5.9.3
Next.js Config:
  output: N/A
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/Mohmdev/nextjs-bun-runtime-regression

To Reproduce

  1. Clone the repo: git clone https://github.com/Mohmdev/nextjs-bun-runtime-regression
  2. Deploy to Vercel (the repo includes a vercel.json with bunVersion: "1.x")
  3. Check the Functions tab in the Vercel deployment — all functions show Node.js runtime
  4. Downgrade next to 16.1.7 (bun add [email protected]) and redeploy
  5. Check the Functions tab again — all functions now show Bun 1.x runtime

No code changes. Same vercel.json. Same bunVersion: "1.x". The only variable is the Next.js version.

Current vs. Expected behavior

Current (16.2.0): All Vercel functions run on Node.js runtime despite bunVersion: "1.x" in vercel.json. Build log shows Running onBuildComplete from Vercel — the adapter-vercel pipeline activates and writes per-function configs that override the project-level bunVersion.

Function size: 553 kB each.

Expected: All functions should run on Bun 1.x, consistent with 16.1.7 behavior and the bunVersion: "1.x" project configuration.

Function size on 16.1.7: 531 kB each.

Build log comparison:

16.2.0 (broken):

Detected Next.js version: 16.2.0
$ bun --bun next build
▲ Next.js 16.2.0 (Turbopack)
  Creating an optimized production build ...
✓ Compiled successfully in 4.4s
✓ Generating static pages using 1 worker (4/4) in 180ms
  Running onBuildComplete from Vercel              <-- adapter activated
Build Completed in /vercel/output [11s]

16.1.7 (working):

Detected Next.js version: 16.1.7
$ bun --bun next build
▲ Next.js 16.1.7 (Turbopack)
  Creating an optimized production build ...
✓ Compiled successfully in 5.7s
✓ Generating static pages using 1 worker (4/4) in 172.7ms
Traced Next.js server files in: 35.941ms           <-- old pipeline, no adapter
Created all serverless functions in: 111.373ms
Build Completed in /vercel/output [16s]

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #106-Ubuntu SMP PREEMPT_DYNAMIC Fri Mar  6 07:58:08 UTC 2026
  Available memory (MB): 15993
  Available CPU cores: 4
Binaries:
  Node: 24.3.0
  npm: 11.6.2
  Yarn: N/A
  pnpm: 10.15.0
Relevant Packages:
  next: 16.2.0 // Latest available version is detected (16.2.0).
  eslint-config-next: 16.2.0
  react: 19.2.4
  react-dom: 19.2.4
  typescript: 5.9.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Runtime

Which stage(s) are affected? (Select all that apply)

Vercel (Deployed)

Additional context

This is a stock create-next-app with zero custom code — no Bun globals, no barrel exports, no workspace packages. The regression is purely from the Next.js version bump.

Workarounds attempted (none worked):

  • experimental: { turbopackInferModuleSideEffects: false } — no effect
  • Setting NEXT_ADAPTER_PATH="" in Vercel env vars — no effect
  • Only downgrading to 16.1.7 restores Bun runtime

Root cause hypothesis: 16.2.0 graduated adapterPath to stable. Vercel auto-injects NEXT_ADAPTER_PATH for 16.2+ builds, activating nextjs/adapter-vercel. The adapter's onBuildComplete writes .vc-config.json per function with a Node.js runtime hardcoded, overriding the project-level bunVersion.

With 16.2.0: Image

With 16.1.7: Image

Related: #91691 reports a similar Bun regression in 16.2.0 but attributes it to turbopackInferModuleSideEffects. That workaround does not fix this case — the adapter pipeline itself is the issue.

extent analysis

Fix Plan

To resolve the issue with Next.js 16.2.0 overriding the bunVersion with Node.js runtime on Vercel, follow these steps:

  1. Downgrade Next.js to 16.1.7: Run bun add [email protected] to ensure compatibility with Bun 1.x runtime.
  2. Set NEXT_ADAPTER_PATH to an empty string: Add an environment variable in your Vercel project settings with NEXT_ADAPTER_PATH as the key and an empty string as the value. This will prevent Vercel from auto-injecting the adapter.
  3. Update vercel.json: Ensure that bunVersion is set to "1.x" in your vercel.json file.

Example vercel.json:

{
  "version": 2,
  "bunVersion": "1.x"
}
  1. Redeploy your application: After making these changes, redeploy your application to Vercel.

Verification

To verify that the fix worked:

  1. Check the Functions tab in your Vercel deployment.
  2. Confirm that all functions are running on the Bun 1.x runtime.
  3. Verify that the function size is approximately 531 kB each.

Extra Tips

  • Keep an eye on the Next.js and Vercel documentation for updates on adapter compatibility and Bun runtime support.
  • If you encounter similar issues in the future, try setting experimental.turbopackInferModuleSideEffects to false in your next.config.js file as a potential workaround. However, this did not resolve the issue in this specific case.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING