-
Notifications
You must be signed in to change notification settings - Fork 2k
Description
Describe the feature you'd like to request
In the monorepo docs, Vercel currently recommends using turbo build
as an override instead of next build when setting up a project that uses turborepo.
This is fine, but clarification is needed around env hashing and how it’s possible for variables to persist across deployments unless dependencies for those variables are explicitly defined in the turborepo pipeline. Anyone new to monorepos or unfamiliar with turborepo could easily get bitten by this.
Take the following example:
You have a monorepo setup using turbo with two projects - a nextjs app and a node server (Heroku+Vercel). Assume staging and production environments are setup for both.
If the next app uses a variable like NEXT_PUBLIC_API_URL to make calls to the server from the front end, this variable will get cached by turbo build
and persist into production deployments and whatever url was set for the prod variable never gets used. It’s even possible to totally remove the env variables from Vercel and they’d still be included in future builds.
Describe the solution you'd like
Add a footnote in the docs about env hashing where the build command is listed and state clearly the relationship between NEXT_PUBLIC variables and turbo build.
Describe alternatives you've considered
@jaredpalmer addresses this in #495, but it would still be great to highlight this behavior in the docs where people will likely find themselves before making it to obscure GitHub issues.