Error with Auth0 on Vercel
Unanswered
Alligator mississippiensis posted this in #help-forum
Alligator mississippiensisOP
Hello guys I am getting an error in logs only when deploying on vercel when using auth0:
Error: Cannot find module '@auth0/nextjs-auth0'
Error: Cannot find module '@auth0/nextjs-auth0'
65 Replies
Asian black bear
Are you absolutely 100% sure that
@auth0/nextjs-auth0 made it into package.json and didn't just get installed locally?Alligator mississippiensisOP
Yes, I am absolutely 100% sure that its in there.
and to check, is it in your package-lock file...
Alligator mississippiensisOP
Its there.
I also tried this:
https://stackoverflow.com/questions/67785200/deployment-on-vercel-with-auth0-cant-resolve-auth0-nextjs-auth0-in-vercel
and the build failed here:
https://stackoverflow.com/questions/67785200/deployment-on-vercel-with-auth0-cant-resolve-auth0-nextjs-auth0-in-vercel
and the build failed here:
@Alligator mississippiensis Click to see attachment
this doesn't look like npm lock file tho... as you are saying you used npm install
Alligator mississippiensisOP
Its pnpm
Yes
I tried using npm install
but before I used pnpm
ahh that was you trying to fix it
Alligator mississippiensisOP
same issue
I tried pnpm, npm and yarn same issue.
and you don't have like any other package locks for other package managers (as it may be getting confused)
/ make sure your install script just does pnpm install
@riský and you don't have like any other package locks for other package managers (as it may be getting confused)
Alligator mississippiensisOP
ahh i don't see why it doesn't install it
@Alligator mississippiensis Click to see attachment
but you could try this example, but use pnpm version instead on npm...
like pnpm install @auth0/nextjs-auth0
Alligator mississippiensisOP
Yes, I tried, let me try again and see.
Also it worked before, what I did before the issue started was change region and redeploy.
Like sometime yesterday.
hmm, that is sad
Alligator mississippiensisOP
then I started getting this in logs
also this:
Error: Cannot find module '@auth0/nextjs-auth0'
Error: Cannot find module '@auth0/nextjs-auth0'
wait
It got fixed
YAY!
Alligator mississippiensisOP
Lets go
did you do anything, or did it just start working again
Alligator mississippiensisOP
start working again, but I change it to "pnpm install" and "pnpm run build" as you said.
tho I tried setting it like that before, sometimes same issue.
i wonder if vercel just realized from internal logs and fixed it, or just weirdness
Alligator mississippiensisOP
Same, but amazing that it got fixed. If I make any changes and it fails again, I will message here again.
Should I try to redeploy and see if it happens again?
it can't hurt
Alligator mississippiensisOP
I will also change region.
Okay, its building.
F
did you do rebuild without cache?
Alligator mississippiensisOP
@riský did you do rebuild without cache?
Alligator mississippiensisOP
yes
ig you could ask in vercel's github descussions because they check it more than here: https://github.com/orgs/vercel/discussions/categories/bug-report
Alligator mississippiensisOP
Like whats this issue? Everything works on localhost sometimes on Vercel.
I was thinking of trying Netlify coz of this issue.
the error kinda sounds like it is installed because how else does it know to use
/dist/index.js, but has problems...Alligator mississippiensisOP
I will try to change the region back and redeploy.
Should I try to redeploy the build that worked before but use its build cache?
🤷
Alligator mississippiensisOP
lets see ig
oh
well
I will redeploy the latest one without build cache
still
same issue
Alligator mississippiensisOP
also when deploying it shows here that it installed the dependency
Alligator mississippiensisOP
I will try to change it to "@auth0/nextjs-auth0@latest" and see what happens.
still same error