remix-run/remix · error · Error

Unsupported operation kind

Error message

Unsupported operation kind

What it means

The Postgres SQL compiler dispatches on operation.kind (insert, update, delete, upsert, ...) and throws this fallback when the kind is unrecognized. It means a malformed or version-mismatched operation object reached the compiler.

Source

Thrown at packages/data-table-postgres/src/lib/sql-compiler.ts:118

    }
  }

  if (operation.kind === 'delete') {
    return {
      text:
        'delete from ' +
        quotePath(getTableName(operation.table)) +
        compileWhereClause(operation.where, context) +
        compileReturningClause(operation.returning),
      values: context.values,
    }
  }

  if (operation.kind === 'upsert') {
    return compileUpsertOperation(operation, context)
  }

  throw new Error('Unsupported operation kind')
}

function compileInsertOperation(
  table: OperationTable,
  values: Record<string, unknown>,
  returning: '*' | string[] | undefined,
  context: CompileContext,
): SqlStatement {
  let columns = Object.keys(values)

  if (columns.length === 0) {
    return {
      text:
        'insert into ' +
        quotePath(getTableName(table)) +
        ' default values' +
        compileReturningClause(returning),
      values: context.values,

View on GitHub (pinned to 9696913134)

Solutions

  1. Align versions of all data-table packages and reinstall dependencies
  2. Build operations with the library's builder APIs rather than plain objects
  3. Log operation.kind before compiling to identify corrupted values; validate deserialized operations

Example fix

# align adapter versions
pnpm up '@remix-run/data-table*'@latest
Defensive patterns

Strategy: validation

Validate before calling

const KINDS = new Set(['insert','update','delete','upsert'])
if (!KINDS.has(op.kind)) throw new Error('Unknown operation kind: ' + op.kind)

Type guard

function isOperation(o: unknown): o is Operation { return !!o && typeof o === 'object' && ['insert','update','delete','upsert'].includes((o as { kind?: string }).kind ?? '') }

Prevention

When it happens

Trigger: Passing an operation object with a missing/misspelled `kind` to the compile/execute path; version skew between the data-table core (which may emit new operation kinds) and the Postgres adapter; hand-built or deserialized operation objects losing their discriminant.

Common situations: Upgrading @remix-run/data-table without upgrading data-table-postgres; caching/serializing operations across processes; constructing operations via object literals instead of builder APIs.

Related errors


AI-assisted analysis of remix-run/remix@9696913134 (2026-08-27). Data as JSON: /api/errors/abd500b22661e052. Report an issue: GitHub.