Instead of manually copying env vars from the Vercel dashboard, pull them directly via CLI.
Install Vercel CLI
npm i -g vercel
Login
vercel login
Pull Env Vars
vercel env pull .env.local
This creates a .env.local file with all your environment variables from the Vercel project.
Link Project First (if needed)
If your project isn't linked yet:
vercel link
Then pull again.
Make sure
.env.localis in your.gitignore.