next.js: Account specific deployment fail on with next-auth

Verify canary release

  • I verified that the issue exists in Next.js canary release

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP Wed Feb 19 06:37:35 UTC 2020
Binaries:
  Node: 16.14.0
  npm: 8.5.2
  Yarn: N/A
  pnpm: N/A
Relevant packages:
  next: 12.1.7-canary.3
  react: 17.0.2
  react-dom: 17.0.2

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

Vercel

Describe the Bug

I’m having a very strange error related to when trying to deploy any project that uses next-auth. It seems to only affect this particular Vercel account. When I clone the project and deploy it to another Vercel account, it works fine.

I also also tried this on another project on my main Vercel account. The build error occurs even when redeploying a previously successful deployment. I have changed nothing since the last successful deployment.

next-auth is version 4.3.4.

Here are the build logs. The error occurs at the very end, after pages seem to be successfully generated. The specific lines:

[09:21:10.292] Error! ENOENT: no such file or directory, stat '.vercel/output/functions/api/auth/[...nextauth].func/node_modules/.bin/next'
[09:21:10.307] Error: Command "vercel build" exited with 1
[09:19:17.331] Cloning github.com/frozberry/swift-course-next (Branch: master, Commit: 2dee2b3)
[09:19:18.015] Cloning completed: 683.375ms
[09:19:18.834] Looking up build cache...
[09:19:19.134] Build Cache not found
[09:19:19.400] Running "vercel build"
[09:19:19.844] Vercel CLI 24.2.1 build (beta) — https://vercel.com/feedback
[09:19:20.114] Installing dependencies...
[09:19:43.420] 
[09:19:43.420] > bloom@0.1.0 postinstall
[09:19:43.420] > prisma generate || true
[09:19:43.420] 
[09:19:44.596] Prisma schema loaded from src/prisma/schema.prisma
[09:19:45.838] 
[09:19:45.838] ✔ Generated Prisma Client (3.10.0 | library) to ./node_modules/@prisma/client in 122ms
[09:19:45.838] You can now start using Prisma Client in your code. Reference: https://pris.ly/d/client
[09:19:45.839] ```
[09:19:45.839] import { PrismaClient } from '@prisma/client'
[09:19:45.839] const prisma = new PrismaClient()
[09:19:45.839] ```
[09:19:45.913] 
[09:19:45.913] added 479 packages in 26s
[09:19:45.913] 
[09:19:45.913] 94 packages are looking for funding
[09:19:45.914]   run `npm fund` for details
[09:19:45.935] Detected Next.js version: 12.1.6
[09:19:45.940] Running "npm run vercel-build"
[09:19:46.214] 
[09:19:46.215] > bloom@0.1.0 vercel-build
[09:19:46.215] > prisma generate && prisma migrate deploy && next build
[09:19:46.215] 
[09:19:47.381] Prisma schema loaded from src/prisma/schema.prisma
[09:19:48.625] 
[09:19:48.625] ✔ Generated Prisma Client (3.10.0 | library) to ./node_modules/@prisma/client in 130ms
[09:19:48.625] You can now start using Prisma Client in your code. Reference: https://pris.ly/d/client
[09:19:48.625] ```
[09:19:48.625] import { PrismaClient } from '@prisma/client'
[09:19:48.625] const prisma = new PrismaClient()
[09:19:48.625] ```
[09:19:48.749] ┌─────────────────────────────────────────────────────────┐
[09:19:48.750] │  Update available 3.10.0 -> 3.13.0                      │
[09:19:48.750] │  Run the following to update                            │
[09:19:48.750] │    npm i --save-dev prisma@latest                       │
[09:19:48.750] │    npm i @prisma/client@latest                          │
[09:19:48.750] └─────────────────────────────────────────────────────────┘
[09:19:49.919] Prisma schema loaded from src/prisma/schema.prisma
[09:19:49.967] Datasource "db": PostgreSQL database "postgres", schema "public" at "db.yetkkuhyiqmymspsaodh.supabase.co:5432"
[09:19:50.531] 
[09:19:50.531] 1 migration found in prisma/migrations
[09:19:50.532] 
[09:19:50.875] 
[09:19:50.875] No pending migrations to apply.
[09:19:51.607] warn  - SWC minify release candidate enabled. https://nextjs.org/docs/messages/swc-minify-enabled
[09:19:51.630] Attention: Next.js now collects completely anonymous telemetry regarding usage.
[09:19:51.630] This information is used to shape Next.js' roadmap and prioritize features.
[09:19:51.631] You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
[09:19:51.631] https://nextjs.org/telemetry
[09:19:51.632] 
[09:19:51.670] info  - Checking validity of types...
[09:20:02.074] info  - Creating an optimized production build...
[09:20:55.344] info  - Compiled successfully
[09:20:55.344] info  - Collecting page data...
[09:20:57.766] info  - Generating static pages (0/8)
[09:20:57.834] info  - Generating static pages (2/8)
[09:20:57.869] info  - Generating static pages (4/8)
[09:20:57.880] info  - Generating static pages (6/8)
[09:20:57.890] info  - Generating static pages (8/8)
[09:20:58.395] info  - Finalizing page optimization...
[09:20:58.398] 
[09:20:58.406] Page                                       Size     First Load JS
[09:20:58.406] ┌ ○ /                                      6.03 kB         161 kB
[09:20:58.407] ├   /_app                                  0 B             109 kB
[09:20:58.407] ├ ○ /[courseName]                          23 kB           178 kB
[09:20:58.407] ├ ○ /404                                   179 B           109 kB
[09:20:58.407] ├ ○ /account                               3.24 kB         198 kB
[09:20:58.407] ├ λ /api/auth/[...nextauth]                0 B             109 kB
[09:20:58.407] ├ λ /api/auth/verify-login                 0 B             109 kB
[09:20:58.408] ├ λ /api/courses/[course]                  0 B             109 kB
[09:20:58.408] ├ λ /api/emails                            0 B             109 kB
[09:20:58.408] ├ λ /api/emails/emails                     0 B             109 kB
[09:20:58.408] ├ λ /api/stripe/checkout                   0 B             109 kB
[09:20:58.408] ├ λ /api/stripe/webhook                    0 B             109 kB
[09:20:58.408] ├ λ /api/users                             0 B             109 kB
[09:20:58.408] ├ λ /api/users/[id]                        0 B             109 kB
[09:20:58.408] ├ λ /api/users/password                    0 B             109 kB
[09:20:58.408] ├ λ /api/users/password-reset              0 B             109 kB
[09:20:58.408] ├ λ /api/users/self                        0 B             109 kB
[09:20:58.408] ├ λ /api/users/users                       0 B             109 kB
[09:20:58.409] ├ ○ /forgot-password                       2.8 kB          198 kB
[09:20:58.409] ├ ○ /login                                 3.67 kB         195 kB
[09:20:58.409] └ ○ /reset-password/[token]                1.28 kB         178 kB
[09:20:58.409] + First Load JS shared by all              109 kB
[09:20:58.409]   ├ chunks/framework-4fadf02ee0c3c13f.js   42.2 kB
[09:20:58.409]   ├ chunks/main-eb7d0d223d8a77a6.js        33.2 kB
[09:20:58.409]   ├ chunks/pages/_app-1e93bdfef1c99e15.js  32.4 kB
[09:20:58.410]   ├ chunks/webpack-a46d3daae114f2e4.js     1.05 kB
[09:20:58.410]   └ css/f4a6a094b450d52f.css               121 B
[09:20:58.410] 
[09:20:58.410] λ  (Server)  server-side renders at runtime (uses getInitialProps or getServerSideProps)
[09:20:58.410] ○  (Static)  automatically rendered as static HTML (uses no initial props)
[09:20:58.410] 
[09:20:58.919] Traced Next.js server files in: 332.815ms
[09:21:09.525] Created all serverless functions in: 10.604s
[09:21:10.292] Error! ENOENT: no such file or directory, stat '.vercel/output/functions/api/auth/[...nextauth].func/node_modules/.bin/next'
[09:21:10.307] Error: Command "vercel build" exited with 1

Expected Behavior

Deployment should succeed.

To Reproduce

I’m not sure if this is reproducible. It seems to only to affect my specific Vercel account. When I copy my repo and deploy to another Vercel account, it works fine.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 20 (4 by maintainers)

Most upvoted comments

@frozberry Let’s just hope that it doesn’t come up again 🤞🏽 but if it does and I figure it out, I’ll comment here