anomalyco/sst · info

message

Error message

message

What it means

`warnOnce` in platform/src/util/warn.ts:6 logs a message exactly once per process: it checks a module-level `Set<string>` of already-warned messages, adds the message, then calls console.warn. The error text here is the generic "message" parameter passed through — when called from `normalizeVpc`, a VPC-related warning is being printed once. It is diagnostic output, not a thrown exception.

Source

Thrown at platform/src/util/warn.ts:6

const alreadyWarned = new Set<string>();

export function warnOnce(message: string) {
  if (alreadyWarned.has(message)) return;
  alreadyWarned.add(message);
  console.warn(message);
}

View on GitHub (pinned to a0bd20f762)

Solutions

  1. Read the message text passed to warnOnce by normalizeVpc and fix the underlying VPC configuration in sst.config.ts (explicitly set the correct `vpc` id/subnets on the component)
  2. Run `sst dev` or `sst deploy` once and capture the full warning to identify which VPC input triggered it
  3. If the warning is expected (e.g. intentional default-VPC fallback), it can be safely ignored — it prints at most once per process

Example fix

// before (triggers warning)
new sst.aws.Function("Api", { handler: "src/index.handler" });

// after (explicit VPC, avoids normalization warning)
const vpc = new sst.aws.Vpc("MyVpc");
new sst.aws.Function("Api", {
  handler: "src/index.handler",
  vpc,
});
Defensive patterns

Strategy: fallback

Validate before calling

// Validate VPC config before creating components that normalize VPC input
if (!config.vpc && process.env.SST_VPC_ID) {
  console.log("vpc id provided via env; explicit config avoids normalization warnings");
}

Prevention

When it happens

Trigger: The first call to `warnOnce(message)` for a given message string, e.g. from `normalizeVpc` when an AWS VPC configuration issue is detected (such as falling back to a default VPC or a missing/ambiguous vpc setting). Subsequent calls with the same message are suppressed by the `alreadyWarned` Set.

Common situations: Deploying an app where the `vpc` config doesn't match an existing VPC so SST normalizes it; re-running `sst deploy`/`sst dev` in watch mode — the warning appears only once per CLI process even if normalizeVpc runs repeatedly; CI logs showing a single VPC warning regardless of how many functions share the VPC.

Related errors


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