🚀Missing environment variable
Error: Missing environment variable: DATABASE_URL
A value kept outside the code, like a secret key or database address (an environment variable), couldn't be found.
🤔 Why does it happen?
- The value isn't in the .env.local file, or its name is different
- It wasn't added to the environment variable settings of your hosting service (Vercel, etc.)
- The server wasn't restarted (or redeployed) after adding the value
- It's used in the browser, but the name doesn't start with NEXT_PUBLIC_ (Next.js)
🔧 Try this
- Compare the variable names one letter at a time
- On Vercel, add it in Settings → Environment Variables, and be sure to deploy again (Redeploy)
- On your computer, save .env.local, then stop and restart the dev server
🤖 Ask your AI like this
I get an error like the one below saying an environment variable can't be found. Please list the environment variables this project needs and where to get each one, and tell me how to add them on my computer (.env.local) and on Vercel. Don't ask me for the actual values. [Paste the full error here]
Replace the [ ] parts with your own situation, and paste the error with a few extra lines before and after it.
Related terms
Other errors in this group
- Build failed (deploy failed)
Build failed - Wrong API key
Invalid API key - Timed out (504 Timeout)
504 Gateway Timeout - Domain not found (DNS)
DNS_PROBE_FINISHED_NXDOMAIN - Secure connection error (SSL certificate)
Your connection is not private - Deployed site shows 404 (Vercel NOT_FOUND)
404: NOT_FOUND (Vercel) - Server function failed to run (FUNCTION_INVOCATION_FAILED)
500: FUNCTION_INVOCATION_FAILED - Environment variable is undefined in the browser
process.env 값이 브라우저에서 undefined - Only a white screen after deploying
배포했더니 흰 화면만 나와요