Skip to content

vercel env add reports success but stores empty string (CLI 53.3.2) #16289

@brianfofficial

Description

@brianfofficial

Bug

vercel env add NAME <environment> reports Added Environment Variable with a normal timing line, but vercel env pull shows the variable stored as empty string "".

Reproduce

CLI version: Vercel CLI 53.3.2 (confirmed via vercel --version).

All three input patterns reproduce the bug 100% of the time:

# Pattern 1: stdin via printf (no trailing newline)
printf "%s" "2026-06-30" | vercel env add LIFETIME_SUNSET_DATE production
# Output: "Added Environment Variable LIFETIME_SUNSET_DATE to Project ... [204ms]"

# Pattern 2: --value flag
vercel env add LIFETIME_SUNSET_DATE production --value "2026-06-30" --yes
# Output: same success line

# Pattern 3: file redirect (file confirmed 10 bytes via wc -c)
printf "%s" "2026-06-30" > /tmp/sunset-date.txt
vercel env add LIFETIME_SUNSET_DATE production --yes < /tmp/sunset-date.txt
# Output: same success line

# Verify after each:
vercel env pull .env.verify --environment=production
grep "^LIFETIME_SUNSET_DATE=" .env.verify | od -c
# Output: D A T E = " " \n     <- empty string, not "2026-06-30"

Expected

vercel env pull should return LIFETIME_SUNSET_DATE="2026-06-30" after any of the three patterns.

Actual

Returns LIFETIME_SUNSET_DATE="" after every pattern, despite CLI success message.

Severity

High. Silent failure on env set is dangerous for secret rotation: Stripe webhook secrets, HMAC keys, service role tokens could all silently rotate to empty string with a green CLI receipt. Production outage with no error signal until the next webhook signature verify or API call fails.

Additional notes

  • Preview environment has a separate bug: vercel env add NAME preview returns a JSON guidance hint instead of executing, requiring --value <value> --yes --force to attempt at all (which still then hits the empty-storage bug).
  • Dashboard env-var add works correctly; this is CLI-only.
  • Project is on default Pro plan, env target retentioncheck-v2.

Workaround

Use Vercel Dashboard (Settings -> Environment Variables) until CLI fix lands.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions