clockworklabs/SpacetimeDB · error · TypeError

could not serialize result: object had neither a `ok` nor…

Error message

could not serialize result: object had neither a `ok` nor an `err` field

What it means

spacetime update install <version> accepts an --edition flag (comma-separated list, default "standalone"), but the installer currently implements only the standalone edition. The guard requires the parsed list to equal exactly ["standalone"]; anything else fails before any network I/O happens.

Solutions

  1. Drop the --edition flag entirely; the default is standalone.
  2. If you must pass it, pass exactly --edition standalone (single value, no extra list entries).
  3. For hosted deployments, use the server/provider provisioning flow instead of the local installer.

Example fix

# before
spacetime update install 1.7.0 --edition cloud

# after
spacetime update install 1.7.0
Defensive patterns

Strategy: validation

Prevention

When it happens

Trigger: Running spacetime update install 1.7.0 --edition cloud, --edition enterprise, or a multi-value like --edition standalone,cloud (value_delimiter=',' splits it into a list that no longer equals ["standalone"]).

Common situations: Assuming a cloud/enterprise edition can be installed locally with this CLI; scripts or docs carrying an edition flag; templates inserting the flag automatically.

Related errors


AI-assisted analysis of clockworklabs/SpacetimeDB@6dee26c6ef (2026-08-20). Data as JSON: /api/errors/f948691288947a28. Report an issue: GitHub.

Appendix: source

Thrown at crates/bindings-typescript/src/lib/algebraic_type.ts:672

    ) {
      const serializeOk = AlgebraicType.makeSerializer(
        ty.variants[0].algebraicType,
        typespace
      );
      const serializeErr = AlgebraicType.makeSerializer(
        ty.variants[0].algebraicType,
        typespace
      );

      return (writer, value) => {
        if ('ok' in value) {
          writer.writeU8(0);
          serializeOk(writer, value.ok);
        } else if ('err' in value) {
          writer.writeU8(1);
          serializeErr(writer, value.err);
        } else {
          throw new TypeError(
            'could not serialize result: object had neither a `ok` nor an `err` field'
          );
        }
      };
    } else {
      let serializer = SERIALIZERS.get(ty);
      if (serializer != null) return serializer;

      const serializers: Record<string, Serializer<any>> = {};

      const body = `\
switch (value.tag) {
${ty.variants
  .map(
    ({ name }, i) => `\
  case ${JSON.stringify(name!)}:
    writer.writeByte(${i});
    return this.${name!}(writer, value.value);`

View on GitHub (pinned to 6dee26c6ef)