{"record":{"id":"dc01fa782bea4cf0","repo":"anomalyco/sst","slug":"there-have-been-some-minor-changes-to-the-vpc-co","errorCode":null,"errorMessage":"There have been some minor changes to the \"Vpc\" component that's being referenced by \"${name}\".\n\nTo update, you'll need to redeploy the stage where the VPC was created. And then redeploy this stage.","messagePattern":"There have been some minor changes to the \"Vpc\" component that's being referenced by \"(.+?)\"\\.\n\nTo update, you'll need to redeploy the stage where the VPC was created\\. And then redeploy this stage\\.","errorType":"validation","errorClass":"VisibleError","httpStatus":null,"severity":"error","filePath":"platform/src/components/aws/vpc.ts","lineNumber":482,"sourceCode":"    this.cloudmapNamespace = cloudmapNamespace;\n    this.privateKeyValue = output(privateKeyValue);\n    registerOutputs();\n\n    function reference() {\n      const ref = args as VpcRef;\n      const vpc = ec2.Vpc.get(`${name}Vpc`, ref.vpcId, undefined, {\n        parent: self,\n      });\n\n      const vpcId = vpc.tagsAll.apply((tags) => {\n        registerVersion(\n          tags?.[\"sst:component-version\"]\n            ? parseInt(tags[\"sst:component-version\"])\n            : undefined,\n        );\n\n        if (tags?.[\"sst:ref-version\"] !== _refVersion.toString()) {\n          throw new VisibleError(\n            [\n              `There have been some minor changes to the \"Vpc\" component that's being referenced by \"${name}\".\\n`,\n              `To update, you'll need to redeploy the stage where the VPC was created. And then redeploy this stage.`,\n            ].join(\"\\n\"),\n          );\n        }\n\n        return output(ref.vpcId);\n      });\n\n      const internetGateway = ec2.InternetGateway.get(\n        `${name}InstanceGateway`,\n        ec2.getInternetGatewayOutput(\n          {\n            filters: [{ name: \"attachment.vpc-id\", values: [vpcId] }],\n          },\n          { parent: self },\n        ).internetGatewayId,","sourceCodeStart":464,"sourceCodeEnd":500,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/platform/src/components/aws/vpc.ts#L464-L500","documentation":"When a stage references a VPC created in another stage via `sst.aws.Vpc.get`/`ref`, SST stamps the referenced VPC with an `sst:ref-version` tag derived from the component version. If the tag on the actual VPC does not match what this SST version expects, the reference path throws this VisibleError telling you the provider-side VPC was created by an older (or newer) component version and must be redeployed.","triggerScenarios":"Upgrading SST in the consumer stage (so `_refVersion` changes) while the stage that owns the VPC still has a VPC tagged with the old `sst:ref-version`; running `sst deploy` on a stage that does `Vpc.get` before redeploying the VPC-owning stage.","commonSituations":"Team upgrades SST in the app stage only; CI deploys the app stage against a stale dev-stage VPC; the VPC stage was deployed with a different SST version.","solutions":["In the stage where the VPC was created, run `sst upgrade` (to the same SST version) and `sst deploy` so the VPC is re-stamped with the new ref-version tag.","Then redeploy the current stage so its expected `_refVersion` matches the tag.","If the VPC stage cannot be redeployed, pin the current stage to the SST version that created the VPC."],"exampleFix":"// before (versions out of sync)\n# stage: infra  -> sst deploy (sst v0.x, old ref-version)\n# stage: app    -> sst deploy (sst v0.y, expects new ref-version) // throws\n// after\n# stage: infra  -> sst upgrade && sst deploy   // re-tags VPC\n# stage: app    -> sst deploy                 // versions match","handlingStrategy":"validation","validationCode":"import { EC2Client, DescribeTagsCommand } from \"@aws-sdk/client-ec2\";\nconst tags = await new EC2Client({}).send(new DescribeTagsCommand({\n  Filters: [{ Name: \"resource-id\", Values: [vpcId] }]\n}));\nconst refVersion = tags.Tags?.find(t => t.Key === \"sst:ref-version\")?.Value;\nif (!refVersion) throw new Error(\"VPC lacks sst:ref-version; redeploy the owning stage with the current SST version.\");","typeGuard":"function hasMatchingRefVersion(tags: Record<string, string> | undefined, expected: string): boolean {\n  return tags?.[\"sst:ref-version\"] === expected;\n}","tryCatchPattern":"try {\n  const vpc = sst.aws.Vpc.get(\"Vpc\", { id: vpcId });\n} catch (e) {\n  if (String(e).includes(\"minor changes to the \\\"Vpc\\\" component\")) {\n    console.error(\"Redeploy the stage that owns the VPC with the current SST version, then retry.\");\n  }\n  throw e;\n}","preventionTips":["Keep the same SST version across all stages, especially the stage that owns shared VPCs.","After an SST upgrade, redeploy the VPC-owning stage before any consuming stage.","Pin SST versions in CI so stages cannot drift silently."],"tags":["vpc","versioning","cross-stage","s"],"backgroundTag":"component-version-mismatch","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}