Error: Failed to collect page data for /api/auth/[...nextauth] #67328
Unanswered
brielov
asked this question in
App Router
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to deploy a nextjs app to Fly.io. Fly.io uses docker and even though I've set environment variables, it seems that whenever I run
next build
, next executes my code (I guess for some sort of caching or static thing) and then it fails because of some database connection. This happens on an API route, specifically/api/auth/[...nextauth]
.I don't understand this. Environment variables should be read at runtime, not build time. And if this is failing, I can only guess that nextjs is running my code in some way, otherwise, it should only transpile and libsql should never be executed.
Anyway, how can I disable this behavior?
Beta Was this translation helpful? Give feedback.
All reactions