anomalyco/sst · error · VisibleError

Proxy is not enabled. Enable it with "proxy: true".

Error message

Proxy is not enabled. Enable it with "proxy: true".

What it means

The proxyId getter returns the ID of the RDS proxy created for the MySQL database, but only if proxy support was enabled. If the proxy output is falsy (proxy not enabled), accessing proxyId throws this VisibleError telling you to enable it.

Source

Thrown at platform/src/components/aws/mysql.ts:923

  }

  /**
   * The identifier of the MySQL instance.
   */
  public get id() {
    if (this.dev?.enabled) return output("placeholder");
    return this.instance!.identifier;
  }

  /**
   * The name of the MySQL proxy.
   */
  public get proxyId() {
    if (this.dev?.enabled) return output("placeholder");

    return this.proxy!.apply((v) => {
      if (!v) {
        throw new VisibleError(
          `Proxy is not enabled. Enable it with "proxy: true".`,
        );
      }
      return v.id;
    });
  }

  /** The username of the master user. */
  public get username() {
    if (this.dev?.enabled) return this.dev.username;
    return this.instance!.username;
  }

  /** The password of the master user. */
  public get password() {
    if (this.dev?.enabled) return this.dev.password;
    return this._password!;
  }

View on GitHub (pinned to a0bd20f762)

Solutions

  1. Add proxy: true to the MySql component arguments
  2. Re-deploy so the RDS proxy is created, then access proxyId
  3. If dev mode, proxyId intentionally returns a placeholder and this error won't occur

Example fix

// before
const db = new sst.aws.MySql("MyDb", {});
const proxy = db.proxyId;
// after
const db = new sst.aws.MySql("MyDb", { proxy: true });
const proxy = db.proxyId;
Defensive patterns

Strategy: validation

Validate before calling

const db = new sst.aws.MySql("MyDb", { proxy: true });
// proxyId is only meaningful when proxy is enabled
if (!proxyEnabled) throw new Error("Enable proxy: true before using db.proxyId");

Prevention

When it happens

Trigger: Reading db.proxyId on a MySql component created without `proxy: true`, while not running in dev mode (dev mode returns a placeholder instead).

Common situations: Wiring a function or service to the proxy connection string but forgetting to enable proxy in the component config; enabling proxy in one environment but referencing proxyId in another.

Related errors


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