clockworklabs/SpacetimeDB · error · Error

Could not find SpacetimeDB client! Did you forget to add a `

Error message

Could not find SpacetimeDB client! Did you forget to add a `SpacetimeDBProvider`? `useTable` must be used in the SolidJS component tree under a `SpacetimeDBProvider` component.

What it means

Error "Could not find SpacetimeDB client! Did you forget to add a `SpacetimeDBProvider`? `useTable` must be used in the SolidJS component tree under a `SpacetimeDBProvider` component." thrown in clockworklabs/SpacetimeDB.

Source

Thrown at crates/bindings-typescript/src/solid/useTable.ts:76

 * );
 * ```
 */
export function useTable<TableDef extends UntypedTableDef>(
  query: () => Query<TableDef>,
  callbacks?: UseTableCallbacks<Prettify<RowType<TableDef>>>
): [readonly Prettify<RowType<TableDef>>[], () => boolean] {
  type UseTableRowType = RowType<TableDef>;
  const enabled = callbacks?.enabled ?? (() => true);
  const q = createMemo(query);
  const accessorName = createMemo(() => getQueryAccessorName(q()));
  const whereExpr = createMemo(() => getQueryWhereClause(q()));
  const querySql = createMemo(() => toSql(q()));

  let connectionState: import('./connection_state').ConnectionState;
  try {
    connectionState = useSpacetimeDB();
  } catch {
    throw new Error(
      'Could not find SpacetimeDB client! Did you forget to add a ' +
        '`SpacetimeDBProvider`? `useTable` must be used in the SolidJS component tree ' +
        'under a `SpacetimeDBProvider` component.'
    );
  }

  const [rows, setRows] = createStore<readonly Prettify<UseTableRowType>[]>([]);

  let latestTransactionEventId: string | null = null;

  const computeSnapshot = (): readonly Prettify<UseTableRowType>[] => {
    if (!enabled()) {
      return [];
    }

    const connection = connectionState.getConnection();
    if (!connection) {
      return [];

View on GitHub (pinned to 524b4487d9)

When it happens

Trigger: Thrown at crates/bindings-typescript/src/solid/useTable.ts:76 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/b33c7b2eb89a18ab. Report an issue: GitHub.