{"record":{"id":"005896c185294379","repo":"anomalyco/sst","slug":"missing-name-for-domain","errorCode":null,"errorMessage":"Missing \"name\" for domain.","messagePattern":"Missing \"name\" for domain\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"platform/src/components/aws/app-sync.ts","lineNumber":528,"sourceCode":"    const certificateArn = createSsl();\n    const domainName = createDomainName();\n    createDnsRecords();\n\n    this.constructorName = name;\n    this.constructorOpts = opts;\n    this.api = api;\n    this.domainName = domainName;\n\n    this.registerOutputs({ _hint: this.url });\n\n    function normalizeDomain() {\n      if (!args.domain) return;\n\n      // validate\n      output(args.domain).apply((domain) => {\n        if (typeof domain === \"string\") return;\n\n        if (!domain.name) throw new Error(`Missing \"name\" for domain.`);\n        if (domain.dns === false && !domain.cert)\n          throw new Error(\n            `Need to provide a validated certificate via \"cert\" when DNS is disabled`,\n          );\n      });\n\n      // normalize\n      return output(args.domain).apply((domain) => {\n        const norm = typeof domain === \"string\" ? { name: domain } : domain;\n\n        return {\n          name: norm.name,\n          dns: norm.dns === false ? undefined : norm.dns ?? awsDns(),\n          cert: norm.cert,\n        };\n      });\n    }\n","sourceCodeStart":510,"sourceCodeEnd":546,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/platform/src/components/aws/app-sync.ts#L510-L546","documentation":"The SST AppSync component's `domain` argument accepts either a plain string (the domain name) or an object with `name`, `dns`, `cert` and other fields. During normalization, `normalizeDomain` unwraps the Output-wrapped domain and, if it is an object, requires a `name` property. The library throws because it cannot know which domain name to attach the AppSync domain name and DNS records to.","triggerScenarios":"Passing `domain: { dns: true, hostedZone: \"...\" }` (or any object form) to `new sst.aws.AppSync(...)` without a `name` field, instead of a plain string like `domain: \"api.example.com\"`.","commonSituations":"Copy-pasting a domain config from another component (ApiGateway, etc.) where the property is named differently (e.g. `domainName` or `path`), or refactoring from string form to object form to add `hostedZone`/`cert` and accidentally dropping `name`.","solutions":["Add the `name` field to the domain object, e.g. `domain: { name: \"api.example.com\", hostedZone: \"example.com\" }`","Or pass the domain as a plain string: `domain: \"api.example.com\"` if you don't need custom DNS/cert settings","Check the AppSyncArgs type definition in platform/src/components/aws/app-sync.ts for the exact DomainArgs shape"],"exampleFix":"// before\nnew sst.aws.AppSync(\"Api\", {\n  domain: { hostedZone: \"example.com\", dns: true }\n});\n// after\nnew sst.aws.AppSync(\"Api\", {\n  domain: { name: \"api.example.com\", hostedZone: \"example.com\", dns: true }\n});","handlingStrategy":"validation","validationCode":"function validateAppSyncDomain(domain) {\n  if (typeof domain === \"string\") return;\n  if (domain && typeof domain === \"object\" && !domain.name)\n    throw new Error('AppSync domain object requires a \"name\" field');\n}\nvalidateAppSyncDomain(args.domain);","typeGuard":"function isDomainArgs(d) {\n  return typeof d === \"object\" && d !== null && typeof d.name === \"string\" && d.name.length > 0;\n}","tryCatchPattern":"null","preventionTips":["Prefer the plain-string domain form unless you need dns/cert/hostedZone overrides","When switching to the object form, always copy the existing domain string into `name` first","Type your config with the SST AppSyncArgs domain type so missing `name` is a compile-time error"],"tags":["appsync","config-validation","domain","missing-property"],"backgroundTag":"missing-required-config-property","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}