Configuration
generateBuildId
Provide a release-derived identifier for a build. Use a CI-controlled identifier representing identical content and configuration; do not assign the same ID to different artifacts. This is not a deployment lock or a substitute for shared Server Action keys, cache coordination or compatible database schemas. Example context: Next.js 16.x documentation lane; illustrative snippet or file tree, not executed. Exact candidate patch 16.4.6 remains unverified. Expected behavior / verification: Build with a synthetic RELEASE_ID and check the build identifier; a missing or invalid ID must fail. Prefer promoting the same built artifact across replicas.
Formal Syntax & Structure
nextjs syntaxnextjs
generateBuildId: async () => stringWorking Example
Example Snippetnextjs
export default { async generateBuildId() { const id = process.env.RELEASE_ID; if (!id || !/^[a-zA-Z0-9._-]{1,80}$/.test(id)) throw new Error('Invalid release ID'); return id;} };