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

Error on adding production domain #202

@qlimenoque

Description

@qlimenoque

Hi!

I'm facing a problem while adding a production domain to my project
For some reason, Vercel API thinks I'm adding a preview domain, but at the same time I pass git_branch parameter which is equal to main (terraform plan below) and corresponds to the value of Production Branch in my project (screenshot)

In general I want to create staging and production DNS records and assign those domains to Vercel Project via Terraform

I would appreciate it if you could help me address this problem

CleanShot 2024-09-12 at 12 14 27@2x

Terraform will perform the following actions:
  # module.vercel["project-name"].vercel_project_domain.production[0] will be created
  + resource "vercel_project_domain" "production" {
      + domain     = "project.domain.com"
      + git_branch = "main"
      + id         = (known after apply)
      + project_id = "prj_augQzLjXXXXXXXXXX"
      + team_id    = (known after apply)
    }

Plan: 1 to add, 0 to change, 0 to destroy.
module.vercel["project-name"].vercel_project_domain.production[0]: Creating...


│ Error: Error adding domain to project
│
│   with module.vercel["project-name"].vercel_project_domain.production[0],
│   on ../../modules/vercel/main.tf line 95, in resource "vercel_project_domain" "production":95: resource "vercel_project_domain" "production" {
│
│ Could not add domain project.domain.com to project prj_augQzLjXXXXXXXXXX, unexpected error: cannot_set_production_branch_as_preview - Cannot set Production Branch "main" for a Preview Domain.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions