这是indexloc提供的服务,不要输入任何密码
Skip to content

Docs: Highlight env hashing in Vercel docs #943

@hunterdavisdev

Description

@hunterdavisdev

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.

F189A496-9749-458C-A2B2-A8662D1C078A

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.

Metadata

Metadata

Assignees

Labels

area: docsImprovements or additions to documentationkind: bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions