Hello Vercel Team,
I’m encountering a persistent deployment issue with my Next.js project (v15.4.6) on Vercel. The build completes successfully, but fails at the serverless deployment step with the following error:
Code
Error: Unable to find lambda for route: /index (the issue started actually in the /content route, which i removed. I created a brand new route /photo-curation, which startet failing instead. At some point the failing route changed to another routes, being /index the last one).
Repository: GitHub - Carles11/mosaic-photography: Image Gallery of classic nude iconic photographers
Latest Failed Build Log: (https://vercel.com/carles-projects-5a7d39cc/mosaic-photography/J8i7XjWggi6SPr5PsE5g7SNB9QMF?filter=errors)
Context
In my last pushes after adding some new routes and Features in branch “auth-logic”, this error appeared and has persisted since then. The “main” branch deploys just correctly without any issues.
Troubleshooting Steps Taken
Over the last several days, I have methodically attempted to resolve this issue. Here is what I have tried so far:
- Confirmed that affected routes are static: Verified that
/indexand other routes are being prerendered as static HTML files (not dynamic/serverless) by Next.js. These routes do not require a lambda, so the error about a missing lambda for/indexis unexpected. - Tried multiple Next.js versions: Downgraded Next.js to several earlier versions.
- Removed vercel.json: Eliminated any custom Vercel configuration file.
- Renamed problematic routes: The error moved from /content to other routes after renaming.
- Created fresh routes: Created entirely new routes with identical logic; the lambda error persisted.
- Converted routes to Server Components: Changed /index to a Server Component without resolving the issue.
- Created a new Vercel project: Deployed the same repo to a new Vercel project—same result.
- Tested on different environments: Built and deployed from both native Windows 11 and WSL—error persists.
- Tested on Render.com: The site builds and deploys perfectly (no errors) on Render.com.
- No issues locally: The app runs flawlessly on local development.
- Investigated build outputs: Inspected .next/server/app directories after local build to ensure routes are built.
- Checked Next.js directory structure: Verified the correct use of /app directory and naming conventions (app/page.tsx).
- Analyzed static/dynamic route outputs: Confirmed that the /index route is output as static HTML, matching the error context.
- Reviewed tsconfig.json and next.config.ts: Ensured standard configurations for Next.js 15+, including module resolution and no custom output directories.
- Addressed type definition issues: Fixed previous TypeScript errors related to missing type definitions (e.g., minimatch), carefully reviewed if config changes could affect build output.
- Inspected Vercel build logs: Analyzed the entire build and deployment log for clues—confirmed build succeeds, error only appears at lambda creation.
- Consulted community resources: Searched for similar issues on forums/GitHub, attempted all suggested workarounds.
- Reviewed TypeScript path aliases: Checked and verified the
"paths"mapping intsconfig.json("@/*": ["./src/*"]). Ensured all imports match the alias and that the underlying file structure is correct. - Confirmed no conflicts or missing files: Ensured all files referenced by the alias exist under
src/and that no accidental misalignment or case-sensitivity issues exist (especially relevant on Windows vs. Linux file systems). - Validated that build output includes all aliased files: After building locally, confirmed that all expected routes/components are present in the
.nextoutput. - Checked for cross-platform path separator issues: Reviewed all import paths and TypeScript aliases to ensure consistent use of forward slashes (
/), addressing potential differences between Windows and Linux file systems. Confirmed there are no Windows-style backslashes (\) in code or config files that could cause build inconsistencies on Vercel. - Configured Git to use consistent line endings: Set
core.autocrlftoinput(git config core.autocrlf input) to ensure all committed files use Unix-style LF endings, preventing cross-platform line ending issues between Windows and Linux environments.
Additional Details
The project uses the Next.js App Router (app directory).
My images are hosted on AWS S3, distributed via Cloudflare CDN, and fetched from Supabase on the frontend.
No custom output or build directory is set, and the tsconfig.json is standard for Next.js 15+.
All build and static export steps on Vercel succeed; the error is only at the lambda creation/deployment phase.
The project structure and logic do not appear to include anything non-standard that would affect lambda generation.
Request
I would appreciate any help in diagnosing or resolving this issue. My preference is to stay on Vercel due to your excellent image/CDN and performance stack, which is critical for my use case.
Is there anything in my project setup or Vercel configuration that could be causing this?
Would it be possible to have deeper insight into why the lambda for /index is not being created, despite a successful build and static export?
Thank you very much for your time and support!
Best regards,
Carles
The server logs:
[15:18:06.163] Running build in Washington, D.C., USA (East) – iad1
[15:18:06.163] Build machine configuration: 2 cores, 8 GB
[15:18:06.185] Cloning GitHub - Carles11/mosaic-photography: Image Gallery of classic nude iconic photographers (Branch: auth-logic, Commit: a46f38b)
[15:18:06.681] Cloning completed: 496.000ms
[15:18:10.263] Restored build cache from previous deployment (Emk2F8KFZoMRBNx5y8xehYmvVHqu)
[15:18:12.370] Running “vercel build”
[15:18:12.880] Vercel CLI 44.7.3
[15:18:13.221] Installing dependencies…
[15:18:13.598] yarn install v1.22.19
[15:18:13.681] [1/4] Resolving packages…
[15:18:14.009] [2/4] Fetching packages…
[15:18:47.436] [3/4] Linking dependencies…
[15:18:47.438] warning " > @cloudflare/next-on-pages@1.13.13" has unmet peer dependency “wrangler@^3.28.2 || ^4.0.0”.
[15:18:47.439] warning “next-pwa > babel-loader@8.4.1” has unmet peer dependency “@babel/core@^7.0.0”.
[15:18:47.440] warning “next-pwa > babel-loader@8.4.1” has unmet peer dependency “webpack@>=2”.
[15:18:47.440] warning “next-pwa > clean-webpack-plugin@4.0.0” has unmet peer dependency “webpack@>=4.0.0 <6.0.0”.
[15:18:47.440] warning “next-pwa > terser-webpack-plugin@5.3.14” has unmet peer dependency “webpack@^5.1.0”.
[15:18:47.440] warning “next-pwa > workbox-webpack-plugin@6.6.1” has unmet peer dependency “webpack@^4.4.0 || ^5.9.0”.
[15:18:47.444] warning " > react-photoswipe-gallery@3.1.1" has unmet peer dependency “prop-types@>= 15.7.0”.
[15:18:47.447] warning " > slick-carousel@1.8.1" has unmet peer dependency “jquery@>=1.8.0”.
[15:18:54.624] [4/4] Building fresh packages…
[15:18:55.266] Done in 41.67s.
[15:18:55.294] Detected Next.js version: 15.4.6
[15:18:55.296] Running “yarn run vercel-build”
[15:18:55.464] yarn run v1.22.19
[15:18:55.490] $ NEXT_IGNORE_TSC_ERRORS=1 next build
[15:18:56.767] pwa.config.js is being used!
[15:18:56.768] { isDev: false }
[15:18:56.929] { isDev: false }
[15:18:56.934] ▲ Next.js 15.4.6
[15:18:56.935]
[15:18:56.963] Creating an optimized production build …
[15:18:57.077] > [PWA] Compile server
[15:18:57.078] > [PWA] Compile server
[15:18:57.079] > [PWA] Compile client (static)
[15:18:57.080] > [PWA] Auto register service worker with: /vercel/path0/node_modules/next-pwa/register.js
[15:18:57.080] > [PWA] Service worker: /vercel/path0/public/sw.js
[15:18:57.081] > [PWA] url: /sw.js
[15:18:57.081] > [PWA] scope: /
[15:19:14.728] ✓ Compiled successfully in 17.0s
[15:19:14.732] Linting and checking validity of types …
[15:19:25.125] Collecting page data …
[15:19:28.317] Generating static pages (0/15) …
[15:19:29.551] Generating static pages (3/15)
[15:19:29.552] Generating static pages (7/15)
[15:19:29.552] Generating static pages (11/15)
[15:19:29.552] ✓ Generating static pages (15/15)
[15:19:30.051] Finalizing page optimization …
[15:19:30.056] Collecting build traces …
[15:19:37.071]
[15:19:37.079] Route (app) Size First Load JS
[15:19:37.080] ┌ ○ / 57 kB 249 kB
[15:19:37.080] ├ ○ /_not-found 291 B 106 kB
[15:19:37.080] ├ ○ /auth/confirm-email 1.02 kB 110 kB
[15:19:37.080] ├ ○ /auth/forgot-password 1.75 kB 153 kB
[15:19:37.080] ├ ○ /auth/login 2.06 kB 154 kB
[15:19:37.080] ├ ○ /auth/reset-password 2.07 kB 154 kB
[15:19:37.080] ├ ○ /auth/signup 2.02 kB 154 kB
[15:19:37.080] ├ ○ /faq 517 B 147 kB
[15:19:37.080] ├ ○ /legal/credits 705 B 112 kB
[15:19:37.080] ├ ○ /legal/privacy-policy 292 B 106 kB
[15:19:37.080] ├ ○ /legal/terms-of-service 295 B 106 kB
[15:19:37.080] ├ ○ /photo-curations 9.17 kB 206 kB
[15:19:37.080] ├ ○ /profile 3.45 kB 196 kB
[15:19:37.081] └ ƒ /profile/collections/[id] 44.6 kB 239 kB
[15:19:37.081] + First Load JS shared by all 106 kB
[15:19:37.081] ├ chunks/6711-af4a09443f88132c.js 12.8 kB
[15:19:37.081] ├ chunks/9248-41a400e29f5295a5.js 54.1 kB
[15:19:37.081] └ other shared chunks (total) 38.9 kB
[15:19:37.081]
[15:19:37.081]
[15:19:37.081] ƒ Middleware 37.3 kB
[15:19:37.081]
[15:19:37.081] ○ (Static) prerendered as static content
[15:19:37.081] ƒ (Dynamic) server-rendered on demand
[15:19:37.081]
[15:19:37.119] Done in 41.66s.
[15:19:37.263] Traced Next.js server files in: 89.151ms
[15:19:37.603] Created all serverless functions in: 338.564ms
[15:19:37.673] Error: Unable to find lambda for route: /index