clockworklabs/SpacetimeDB · error · Error

Missing type name for

Error message

Missing type name for ${typeBuilder.constructor.name ?? 'TypeBuilder'} ${JSON.stringify(typeBuilder)}

What it means

spacetime publish accepts a parent database either via --parent <parent> or inline in the database name as <parent>/<child>. validate_name_and_parent splits the name on '/'; when both forms are supplied they must designate the same parent, otherwise the request is ambiguous and rejected. (Equal values are allowed and deduplicated; the parent must also be a valid domain or identity.)

Solutions

  1. Drop --parent and keep only the path form: spacetime publish myorg/mydb.
  2. Or keep --parent myorg and pass only the child name: spacetime publish --parent myorg mydb.
  3. If both must appear (e.g. templated commands), make them identical — the duplicate is accepted.

Example fix

# before
spacetime publish --parent alice myorg/mydb

# after
spacetime publish myorg/mydb
# or
spacetime publish --parent myorg mydb
Defensive patterns

Strategy: validation

Validate before calling

if [[ "$DB_NAME" == */* && -n "$PARENT" && "$PARENT" != "${DB_NAME%%/*}" ]]; then
  echo "conflicting parent: --parent $PARENT vs $DB_NAME"; exit 1
fi

Prevention

When it happens

Trigger: spacetime publish --parent alice myorg/mydb where myorg != alice. Also fires for any invocation with a slash-containing name plus a --parent value that differs from the path's first segment.

Common situations: Shell history reuse (--parent left over plus an edited name); wrapper scripts that always set --parent while the user types a path-style name; muscle memory from tools where both are accepted independently.

Related errors


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

Appendix: source

Thrown at crates/bindings-typescript/src/lib/schema.ts:363

      ) as any;
    } else {
      return typeBuilder as any;
    }
  }

  #registerCompoundTypeRecursively<
    T extends
      | SumBuilder<VariantsObj>
      | ProductBuilder<ElementsObj>
      | RowBuilder<RowObj>,
  >(typeBuilder: T): RefBuilder<Infer<T>, InferSpacetimeTypeOfTypeBuilder<T>> {
    const ty = typeBuilder.algebraicType;
    // NB! You must ensure that all TypeBuilder passed into this function
    // have a name. This function ensures that nested types always have a
    // name by assigning them one if they are missing it.
    const name = typeBuilder.typeName;
    if (name === undefined) {
      throw new Error(
        `Missing type name for ${typeBuilder.constructor.name ?? 'TypeBuilder'} ${JSON.stringify(typeBuilder)}`
      );
    }

    let r = this.#compoundTypes.get(ty);
    if (r != null) {
      // Already added to typespace
      return r;
    }

    // Recursively register nested compound types
    const newTy =
      typeBuilder instanceof RowBuilder || typeBuilder instanceof ProductBuilder
        ? ({
            tag: 'Product',
            value: { elements: [] },
          } as AlgebraicTypeVariants.Product)
        : ({

View on GitHub (pinned to eddf9f5014)