Hey there 👋🏻
I had some trouble using environment variables with Next.js and Turbo. The build on Vercel was failing because the environment variables were not populated correctly. I could solve this issue by explicitly telling Turbo that the environment variables exist, as documented here: https://turbo.build/repo/docs/crafting-your-repository/using-environment-variables
I'm not sure if this is the standard way of doing this. My normal workflow (without turbo) was previously:
- Create an environment variable within the Vercel dashboard
- Run
vercel env pullon my machine
Now, with Turbo, it seems that I need to add a third step:
- Create an environment variable within the Vercel dashboard
- Run
vercel env pullon my machine - Add the environment variable to turbo.config
If this is as intended, it would be awesome if the Vercel CLI recognized that I'm using Turbo and therefore added the environment variable to the config automatically.
This would eliminate the third step above, remove any confusion around environment variables, and ultimately improve developer experience and enhance the integration of Vercel and Turbo.