anomalyco/sst · error · VisibleError

You are using the "Vpc.v1" component. Please migrate to the

Error message

You are using the "Vpc.v1" component. Please migrate to the latest "Vpc" component.

What it means

SST renamed and redesigned the VPC component; the old one remains importable as Vpc.v1. Cluster no longer accepts Vpc.v1 instances, so passing one produces a VisibleError instructing migration to the new Vpc component.

Source

Thrown at platform/src/components/aws/cluster.ts:268

            [
              `There have been some minor changes to the "Cluster" component that's being referenced by "${name}".\n`,
              `To update, you'll need to redeploy the stage where the cluster was created. And then redeploy this stage.`,
            ].join("\n"),
          );
        }

        registerVersion(refVersion);

        return cluster;
      });

      return { cluster: clusterValidated };
    }

    function normalizeVpc() {
      // "vpc" is a Vpc.v1 component
      if (args.vpc instanceof VpcV1) {
        throw new VisibleError(
          `You are using the "Vpc.v1" component. Please migrate to the latest "Vpc" component.`,
        );
      }

      // "vpc" is a Vpc component
      if (args.vpc instanceof Vpc) {
        return args.vpc;
      }

      // "vpc" is object
      return output(args.vpc).apply((vpc) => {
        if (vpc.containerSubnets && vpc.serviceSubnets)
          throw new VisibleError(
            `You cannot provide both "vpc.containerSubnets" and "vpc.serviceSubnets" in the "${name}" Cluster component. The "serviceSubnets" property has been deprecated. Use "containerSubnets" instead.`,
          );
        if (!vpc.containerSubnets && !vpc.serviceSubnets)
          throw new VisibleError(
            `Missing "vpc.containerSubnets" for the "${name}" Cluster component.`,

View on GitHub (pinned to a0bd20f762)

Solutions

  1. Replace new sst.aws.Vpc.v1('MyVpc', ...) with the new sst.aws.Vpc component and migrate its args (e.g. nat, subnets layout changes).
  2. Point the Cluster's vpc arg at the new Vpc instance.
  3. See the SST Vpc v1 migration guide for the argument mapping.

Example fix

// before
const vpc = new sst.aws.Vpc.v1('MyVpc', { nat: 'auto' });
const cluster = new sst.aws.Cluster('MyCluster', { vpc });
// after
const vpc = new sst.aws.Vpc('MyVpc', { nat: 'auto' });
const cluster = new sst.aws.Cluster('MyCluster', { vpc });
Defensive patterns

Strategy: type-guard

Validate before calling

function assertNewVpc(vpc) {
  if (vpc instanceof sst.aws.VpcV1)
    throw new Error('Migrate to sst.aws.Vpc before passing to Cluster');
}
assertNewVpc(vpc);

Type guard

const isVpcV1 = (vpc) => vpc instanceof sst.aws.VpcV1;

Prevention

When it happens

Trigger: new sst.aws.Cluster(...) with args.vpc set to an instance created by the legacy Vpc.v1 component (imported from sst.aws.VpcV1). Detected by instanceof VpcV1 in normalizeVpc.

Common situations: Upgrading SST across a breaking Vpc redesign: old vpc.v1.ts code still instantiates Vpc.v1 while Cluster was updated; copy-pasted examples from older SST docs.

Related errors


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