{"record":{"id":"70efd5b69627d4a6","repo":"anomalyco/sst","slug":"prop-is-not-linked-in-your-sst-config-ts","errorCode":null,"errorMessage":"\"${prop}\" is not linked in your sst.config.ts","messagePattern":"\"(.+?)\" is not linked in your sst\\.config\\.ts","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"sdk/js/src/resource/shared.ts","lineNumber":66,"sourceCode":"  return new Proxy(raw, {\n    get(_target, prop: string | symbol) {\n      loadData();\n      if (prop in raw) {\n        return raw[prop as string];\n      }\n      if (typeof prop !== \"string\") {\n        return undefined;\n      }\n      if (!environment.SST_RESOURCE_App && !raw.App) {\n        throw new Error(\n          \"It does not look like SST links are active. If this is in local development and you are not starting this process through the multiplexer, wrap your command with `sst dev -- <command>`\",\n        );\n      }\n      let msg = `\"${prop}\" is not linked in your sst.config.ts`;\n      if (environment.AWS_LAMBDA_FUNCTION_NAME) {\n        msg += ` to ${environment.AWS_LAMBDA_FUNCTION_NAME}`;\n      }\n      throw new Error(msg);\n    },\n    has(_target, prop: string | symbol) {\n      loadData();\n      return prop in raw;\n    },\n    ownKeys() {\n      loadData();\n      return Reflect.ownKeys(raw);\n    },\n    getOwnPropertyDescriptor(_target, prop: string | symbol) {\n      loadData();\n      return Object.getOwnPropertyDescriptor(raw, prop);\n    },\n  }) as T;\n}\n","sourceCodeStart":48,"sourceCodeEnd":82,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/sdk/js/src/resource/shared.ts#L48-L82","documentation":"SST's Resource proxy throws this when you access a property (resource name) that was not linked to the current function in sst.config.ts. Only resources explicitly linked via bind() are available through Resource at runtime.","triggerScenarios":"Accessing Resource.<Name> where Name is not in the function's link list — e.g. `Resource.MyTable` when the function was defined without `bind: [MyTable]`, or the property name is misspelled/differs from the config variable name.","commonSituations":"Forgetting to add the resource to `bind` in sst.config.ts; referencing the resource under a different identifier than the one bound; copy-pasting Resource access into a new function that lacks the link; typos in the resource property name.","solutions":["Add the resource to the function's bind array in sst.config.ts and redeploy: sst.bind([MyTable], ...) / `bind: [MyTable]`.","Verify the accessed property name exactly matches the linked resource's variable name in sst.config.ts.","Check the error's appended message (`to <AWS_LAMBDA_FUNCTION_NAME>` when in Lambda) to confirm which function is missing the link.","Run `sst dev`/`sst deploy` after changing bindings — links are baked in at deploy time, not runtime."],"exampleFix":"// before (sst.config.ts)\nconst fn = new sst.aws.Function(\"Api\", {\n  handler: \"src/api.handler\",\n});\n// src/api.ts: Resource.MyTable.tableName\n\n// after\nconst table = new sst.aws.Dynamo(\"MyTable\");\nconst fn = new sst.aws.Function(\"Api\", {\n  handler: \"src/api.handler\",\n  link: [table],\n});\n// redeploy: sst deploy","handlingStrategy":"validation","validationCode":"// sst.config.ts: keep a single source of truth for bound resources\nconst links = [table, bucket];\nconst fn = new sst.aws.Function(\"Api\", { handler: \"src/api.handler\", link: links });\n// in code, access only known-linked resources:\nconst linked = new Set([\"MyTable\", \"MyBucket\"]);","typeGuard":"// runtime guard via the proxy's `has` trap\nfunction isLinked(name: string): boolean {\n  return name in (Resource as any); // uses `has` trap; no throw\n}","tryCatchPattern":"try {\n  const tableName = Resource.MyTable.name;\n} catch (e) {\n  if (e instanceof Error && e.message.includes(\"is not linked\")) {\n    throw new Error(\"Add MyTable to the function's link array in sst.config.ts and redeploy\");\n  }\n  throw e;\n}","preventionTips":["Always list every resource a function uses in its `link` array.","Use the same variable names in code as in sst.config.ts to avoid typos.","Redeploy (sst deploy / restart sst dev) after changing bindings — links are baked at deploy time.","Use the `in` check (has trap) to probe availability before accessing a resource."],"tags":["links","configuration","sst-config","deployment"],"backgroundTag":"resource-not-linked","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}