{"record":{"id":"de4c29bf11a6d092","repo":"anomalyco/sst","slug":"component-name-args-name-is-reserved-please","errorCode":null,"errorMessage":"Component name \"${args.name}\" is reserved. Please choose a different name for your \"${args.type}\" component.","messagePattern":"Component name \"(.+?)\" is reserved\\. Please choose a different name for your \"(.+?)\" component\\.","errorType":"validation","errorClass":"VisibleError","httpStatus":null,"severity":"error","filePath":"platform/src/components/link.ts","lineNumber":61,"sourceCode":"          ...properties,\n        },\n      });\n    }\n  }\n\n  export function reset() {\n    const links = new Set<string>();\n    // Ensure component names are unique\n    runtime.registerStackTransformation((args) => {\n      const isLinkable =\n        args.type.startsWith(\"sst:\") ||\n        Linkable.wrappedResources.has(args.type);\n      if (isLinkable && !args.opts.parent) {\n        const lcname = args.name.toLowerCase();\n\n        // \"App\" is reserved and cannot be used as a component name.\n        if (lcname === \"app\") {\n          throw new VisibleError(\n            `Component name \"${args.name}\" is reserved. Please choose a different name for your \"${args.type}\" component.`,\n          );\n        }\n\n        // Ensure linkable resources have unique names. This includes all SST components\n        // and non-SST components that are linkable.\n        if (links.has(lcname)) {\n          throw new VisibleError(`Component name ${args.name} is not unique.`);\n        }\n        links.add(lcname);\n      }\n      return {\n        opts: args.opts,\n        props: args.props,\n      };\n    });\n\n    // Create link refs","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/platform/src/components/link.ts#L43-L79","documentation":"SST reserves the component name \"app\" (case-insensitive) for top-level SST components, because the name is used internally (e.g. for app/linking infrastructure) and would collide. During stack registration, `Link.reset()` installs a stack transformation that rejects any top-level linkable SST component whose lowercase name equals \"app\" by throwing a VisibleError.","triggerScenarios":"Declaring any top-level SST component (one without a parent) named \"App\" or \"app\" in any casing, e.g. `new sst.aws.Function(\"App\", {...})` or a wrapped linkable resource named \"app\" in sst.config.ts. Only fires when the resource type starts with `sst:` or is in Linkable.wrappedResources and has no parent.","commonSituations":"Copying example code that names the primary function/app component \"App\"; renaming a component to match a variable called `app`; typos where the developer intended `new sst.App(...)`-style naming; refactors where a subcomponent lost its parent and became top-level.","solutions":["Rename the component to something other than \"App\"/\"app\" in sst.config.ts, e.g. \"MyApp\" or \"Api\".","Check casing: the check is case-insensitive, so \"APP\", \"app\", and \"App\" all fail.","If the component is not intentionally top-level, give it a parent so the transformation skips it.","Run `sst deploy`/`sst dev` again after renaming; also update references to the component's resource name in links or Resource lookups."],"exampleFix":"// before\nconst app = new sst.aws.Function(\"App\", {\n  handler: \"src/api.handler\",\n});\n// after\nconst app = new sst.aws.Function(\"Api\", {\n  handler: \"src/api.handler\",\n});","handlingStrategy":"validation","validationCode":"// In sst.config.ts, before creating a top-level component\nfunction assertValidComponentName(name: string) {\n  if (name.toLowerCase() === \"app\")\n    throw new Error(`Component name \"${name}\" is reserved; use a different name.`);\n  return name;\n}\nconst name = assertValidComponentName(\"Api\");","typeGuard":"function isReservedName(name: string): boolean {\n  return name.toLowerCase() === \"app\";\n}","tryCatchPattern":null,"preventionTips":["Never name top-level SST components \"App\"/\"app\" in any casing","Use descriptive resource names (\"Api\", \"Web\", \"Db\") instead of the generic \"App\"","Keep sub-components nested under a parent so name-collision rules don't apply","Add a code-review checklist item for component naming conventions"],"tags":["sst","naming","configuration","visible-error"],"backgroundTag":"reserved-component-name","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}