I am trying out v0 after using Replit. I’m an engineer, but not super experienced with Typescript/Nextjs.
I have started a nextjs app that requires creating an account and logging in. So far, the preview mode is showing a home page with the right set of features. I can work with it. The project tree looks good.
But when the preview loads, v0 Is prompting me to set my VERCEL_URL - as a first time user one hour into a project, I have no idea what that is or how to discover it.
When I asked v0 about it, this was the reply:
Issue 1: Missing Environment Variables (VERCEL_URL)
You don’t need to manually set VERCEL_URL
- this is automatically set by Vercel in production environments. For local development or preview environments, you should:
- Set NEXTAUTH_URL directly instead:
NEXTAUTH_URL=http://localhost:3000
(or whatever your preview URL is)
My issue with this is, I don’t even know what my preview URL is, I have barely read the docs on nextauth, and just not sure how to proceed.
Is the v0 preview/dev-env considered to be “running locally” ? Asking because, v0 suggested
Additional Troubleshooting Steps
Make sure your .env.local has these values
NEXTAUTH_SECRET=your_secret_here
NEXTAUTH_URL=http://localhost:3000
But when I look at the file list, there is no .env.local
Thus, my confusion - where would put environment variables, even if I knew what to provide for the values?