question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Account specific deployment fail on with next-auth

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:20 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
earlyaugust2commented, May 21, 2022

@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

0reactions
github-actions[bot]commented, Jul 20, 2022

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Errors - NextAuth.js - JS.ORG
This error can occur when a user tries to sign in via an email link; for example, if the email token could not...
Read more >
NextAuth Middleware don't work when deployed to Vercel
Well, i deployed the same test on my Personal Vercel account (Hobby account). The same error happened. Before, i tried on a Pro...
Read more >
How to fix api/auth/error issue of next-auth in production?
2. Correct domain on GCP console. The same should be done in the GCP console, instead of putting https://example.vercel.app/api/auth/callback/Β ...
Read more >
Error: This action with HTTP GET is not supported by NextAuth.js
I have a next.js app that uses next-auth for authentication, ... To confirm that the issue is specific to netlify, I deployed theΒ ......
Read more >
How to use NextAuth.js for client-side authentication in Next.js
Users can login with a GitHub, Google, or Facebook account. ... NextAuth.js Client-Side Authentication Next.js.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found