clockworklabs/SpacetimeDB · error · TypeError

schema entry '${accName}' looks like a default import; use `

Error message

schema entry '${accName}' looks like a default import; use `import * as ${accName} from '...'` so the submodule can see the library's named reducer exports.

What it means

Error "schema entry '${accName}' looks like a default import; use `import * as ${accName} from '...'` so the submodule can see the library's named reducer exports." thrown in clockworklabs/SpacetimeDB.

Source

Thrown at crates/bindings-typescript/src/server/schema.ts:841

    checkExportContext(moduleExport, schema);
    moduleExport[registerExport](schema, name);
  }
}

export function schema<const H extends Record<string, SchemaEntry>>(
  entries: H,
  moduleSettings?: ModuleSettings
): Schema<SchemaDefForEntries<H>> {
  const ctx = new SchemaInner<SchemaDefForEntries<H>>(ctx => {
    // Apply module settings.
    if (moduleSettings?.CASE_CONVERSION_POLICY != null) {
      ctx.setCaseConversionPolicy(moduleSettings.CASE_CONVERSION_POLICY);
    }

    const tableSchemas: Record<string, UntypedTableDef> = {};
    for (const [accName, entry] of Object.entries(entries)) {
      if (entry instanceof Schema) {
        throw new TypeError(
          `schema entry '${accName}' looks like a default import; use \`import * as ${accName} from '...'\` so the submodule can see the library's named reducer exports.`
        );
      }
      if (isSubmoduleNamespace(entry)) {
        const { rawDef, dispatch } =
          entry.default.buildSubmoduleDispatch(entry);
        dispatch.namespace = accName;
        ctx.addSubmodule({ namespace: accName, module: rawDef });
        ctx.submoduleDispatchInfos.push(dispatch);
        continue;
      }
      if (!isUntypedTableSchema(entry)) {
        throw new TypeError(
          `schema entry '${accName}' must be a table or a submodule namespace object`
        );
      }

      const table = entry;

View on GitHub (pinned to 524b4487d9)

When it happens

Trigger: Thrown at crates/bindings-typescript/src/server/schema.ts:841 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of clockworklabs/SpacetimeDB@524b4487d9 (2026-08-16). Data as JSON: /api/errors/92f8213c4a1b36d3. Report an issue: GitHub.