Title:
Build fails on Vercel: ENOENT for page_client-reference-manifest.js on dynamic route ([id]) with Next.js 15 + Bun
Current versus Expected behavior:
- Current:
My project builds and runs perfectly locally (both dev and production), but on Vercel the build fails with the following error:
TheError: ENOENT: no such file or directory, lstat '/vercel/path0/.next/server/app/[variants]/(main)/files/(content)/@modal/[id]/page_client-reference-manifest.js'
[id]
route is dynamic and does not generate this file locally. - Expected:
The build should succeed on Vercel just like it does locally, and dynamic routes should not require static files to be present.
Code, configuration, and steps that reproduce this issue:
- Using Next.js 15 (App Router)
- Using Bun as the package manager and build tool
- Dynamic route:
src/app/[variants]/(main)/files/(content)/@modal/[id]/page.tsx
- No
generateStaticParams
, no static export, no forced static config
- No
next.config.ts
does not useoutput: 'export'
or force static build- Vercel build command:
NODE_OPTIONS=--max-old-space-size=6144 bun run build
- Everything works locally, but fails on Vercel with the error above
Steps to reproduce:
- Deploy the project to Vercel with Bun as the build tool
- Wait for the build to finish
- Observe the ENOENT error for the missing
page_client-reference-manifest.js
file
Project information:
- Framework: Next.js 15 (App Router)
- Environment: Bun (latest), Vercel (Hobby plan)
- Project settings:
- Build command:
NODE_OPTIONS=--max-old-space-size=6144 bun run build
- Output directory: default (
.next
) - No custom output/export config
- Build command:
What I’ve tried:
- Double-checked dynamic route config (no static params, no forced static)
- Compared local and Vercel environments
- Searched for similar issues in Next.js, Bun, and Vercel repos
- Support suggested trying Node.js for build (works locally, but want to use Bun if possible)
Question:
- Is this a known issue with Bun + Next.js 15 on Vercel?
- Is there a workaround or recommended config to avoid this error for dynamic routes?
- Any tips on how to debug or further isolate the cause?
Thanks in advance for any help or insights!