{"record":{"id":"605866ffbff8bb12","repo":"anomalyco/sst","slug":"message","errorCode":null,"errorMessage":"message","messagePattern":"message","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"platform/src/util/warn.ts","lineNumber":6,"sourceCode":"const alreadyWarned = new Set<string>();\n\nexport function warnOnce(message: string) {\n  if (alreadyWarned.has(message)) return;\n  alreadyWarned.add(message);\n  console.warn(message);\n}\n","sourceCodeStart":1,"sourceCodeEnd":8,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/platform/src/util/warn.ts#L1-L8","documentation":"`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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["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)","Run `sst dev` or `sst deploy` once and capture the full warning to identify which VPC input triggered it","If the warning is expected (e.g. intentional default-VPC fallback), it can be safely ignored — it prints at most once per process"],"exampleFix":"// before (triggers warning)\nnew sst.aws.Function(\"Api\", { handler: \"src/index.handler\" });\n\n// after (explicit VPC, avoids normalization warning)\nconst vpc = new sst.aws.Vpc(\"MyVpc\");\nnew sst.aws.Function(\"Api\", {\n  handler: \"src/index.handler\",\n  vpc,\n});","handlingStrategy":"fallback","validationCode":"// Validate VPC config before creating components that normalize VPC input\nif (!config.vpc && process.env.SST_VPC_ID) {\n  console.log(\"vpc id provided via env; explicit config avoids normalization warnings\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always specify an explicit `vpc` (id or Vpc component) on resources that run in a VPC","Read warnOnce output once per deploy run — it only surfaces the first occurrence of each issue","Keep sst.config.ts VPC settings in sync with your actual AWS account to avoid normalization fallbacks"],"tags":["vpc","warning","aws","logging"],"backgroundTag":"vpc-configuration-warning","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}