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
- Drop the --edition flag entirely; the default is standalone.
- If you must pass it, pass exactly --edition standalone (single value, no extra list entries).
- 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
- Omit --edition in install scripts; the default is standalone.
- Do not add edition values copied from issue threads or future docs until the installer supports them.
- Pin install scripts to a known-good version of the CLI so new flags do not break CI.
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
- Cannot extract accessor name from query
- Cannot extract table name from query
- Cannot semijoin a table to itself
- Database ' ' is not in the config file. If you want to run…
- Environment key count exceeds limit
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)