anomalyco/sst · error · Error

"${prop}" is not linked in your sst.config.ts

Error message

"${prop}" is not linked in your sst.config.ts

What it means

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.

Source

Thrown at sdk/js/src/resource/shared.ts:66

  return new Proxy(raw, {
    get(_target, prop: string | symbol) {
      loadData();
      if (prop in raw) {
        return raw[prop as string];
      }
      if (typeof prop !== "string") {
        return undefined;
      }
      if (!environment.SST_RESOURCE_App && !raw.App) {
        throw new Error(
          "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>`",
        );
      }
      let msg = `"${prop}" is not linked in your sst.config.ts`;
      if (environment.AWS_LAMBDA_FUNCTION_NAME) {
        msg += ` to ${environment.AWS_LAMBDA_FUNCTION_NAME}`;
      }
      throw new Error(msg);
    },
    has(_target, prop: string | symbol) {
      loadData();
      return prop in raw;
    },
    ownKeys() {
      loadData();
      return Reflect.ownKeys(raw);
    },
    getOwnPropertyDescriptor(_target, prop: string | symbol) {
      loadData();
      return Object.getOwnPropertyDescriptor(raw, prop);
    },
  }) as T;
}

View on GitHub (pinned to a0bd20f762)

Solutions

  1. Add the resource to the function's bind array in sst.config.ts and redeploy: sst.bind([MyTable], ...) / `bind: [MyTable]`.
  2. Verify the accessed property name exactly matches the linked resource's variable name in sst.config.ts.
  3. Check the error's appended message (`to <AWS_LAMBDA_FUNCTION_NAME>` when in Lambda) to confirm which function is missing the link.
  4. Run `sst dev`/`sst deploy` after changing bindings — links are baked in at deploy time, not runtime.

Example fix

// before (sst.config.ts)
const fn = new sst.aws.Function("Api", {
  handler: "src/api.handler",
});
// src/api.ts: Resource.MyTable.tableName

// after
const table = new sst.aws.Dynamo("MyTable");
const fn = new sst.aws.Function("Api", {
  handler: "src/api.handler",
  link: [table],
});
// redeploy: sst deploy
Defensive patterns

Strategy: validation

Validate before calling

// sst.config.ts: keep a single source of truth for bound resources
const links = [table, bucket];
const fn = new sst.aws.Function("Api", { handler: "src/api.handler", link: links });
// in code, access only known-linked resources:
const linked = new Set(["MyTable", "MyBucket"]);

Type guard

// runtime guard via the proxy's `has` trap
function isLinked(name: string): boolean {
  return name in (Resource as any); // uses `has` trap; no throw
}

Try / catch

try {
  const tableName = Resource.MyTable.name;
} catch (e) {
  if (e instanceof Error && e.message.includes("is not linked")) {
    throw new Error("Add MyTable to the function's link array in sst.config.ts and redeploy");
  }
  throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of anomalyco/sst@a0bd20f762 (2026-08-30). Data as JSON: /api/errors/70efd5b69627d4a6. Report an issue: GitHub.