Commit 4a994f62 authored by Brooke Mosby's avatar Brooke Mosby

adding in validation

parent 7e00287d
......@@ -971,8 +971,14 @@ export default async function build(
)
loadedConfig = config
// Validate deploymentId if provided
if (config.deploymentId !== undefined) {
// Validate deploymentId if explicitly configured by user (not from NEXT_DEPLOYMENT_ID env var)
// config.deploymentId may come from either user config or NEXT_DEPLOYMENT_ID env var
// We only validate user-configured IDs since Vercel sets NEXT_DEPLOYMENT_ID with dpl_* format
const isUserConfiguredDeploymentId =
config.deploymentId !== undefined &&
config.deploymentId !== process.env.NEXT_DEPLOYMENT_ID
if (isUserConfiguredDeploymentId) {
if (typeof config.deploymentId !== 'string') {
throw new Error(
`Invalid \`deploymentId\` configuration: must be a string. See https://nextjs.org/docs/messages/deploymentid-not-a-string`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment