anomalyco/sst · error · Error

It does not look like SST links are active. If this is in lo

Error message

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>`

What it means

SST's Resource proxy throws this when a property is accessed but neither the SST_RESOURCE_App environment variable nor raw.App is present — meaning the process was not started through `sst dev`'s multiplexer (or deployed by SST), so the link runtime data was never loaded. It exists to explain why links appear 'dead' in local development.

Source

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

export function createResource<T extends Resource>(load: () => void) {
  let loaded = false;
  const loadData = () => {
    if (loaded) return;
    load();
    loaded = true;
  };

  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) {

View on GitHub (pinned to a0bd20f762)

Solutions

  1. Start the process through the multiplexer: `sst dev -- <your command>` (e.g. `sst dev -- npm run dev`).
  2. If this is deployed code, ensure the function was deployed by SST so SST_RESOURCE_App is injected.
  3. For tests or non-SST scripts, avoid importing Resource at module scope or mock the resource environment variables.
  4. Confirm the process actually runs inside the multiplexer-spawned environment (check process.env.SST_RESOURCE_App) rather than a separately spawned child.

Example fix

// before (package.json)
"scripts": { "dev": "bun run index.ts" }
// run: npm run dev

// after
"scripts": { "dev": "sst dev -- bun run index.ts" }
// run: npm run dev (or directly: sst dev -- bun run index.ts)
Defensive patterns

Strategy: validation

Validate before calling

// before touching Resource, check the link runtime is active
if (!process.env.SST_RESOURCE_App) {
  console.error("Start with: sst dev -- <your command>");
  process.exit(1);
}

Type guard

function isSstDevActive(): boolean {
  return Boolean(process.env.SST_RESOURCE_App);
}

Try / catch

try {
  const bucket = Resource.MyBucket.name;
} catch (e) {
  if (e instanceof Error && e.message.includes("SST links are active")) {
    throw new Error("Run via: sst dev -- <command>");
  }
  throw e;
}

Prevention

When it happens

Trigger: Accessing any property on Resource (e.g. Resource.MyBucket.bucketName) in a locally run process where environment.SST_RESOURCE_App and raw.App are both unset — i.e. the process was started directly (node/bun script) instead of via `sst dev -- <command>`.

Common situations: Running `npm run dev` or `bun run index.ts` directly instead of through the SST multiplexer; running tests that import Resource outside `sst dev`; an app name mismatch causing SST_RESOURCE_App to be missing; stale .env not produced by SST.

Understand the failure class

Background: "environment variable is not set" and "Missing keys in environment" errors: what missing required env var messages mean and how to fix them — this error's family across 28 libraries.

Related errors


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