tursodatabase/turso · error · LibsqlError

UNSUPPORTED_CONFIG

UNSUPPORTED_CONFIG

Error message

Unsupported configuration options: ${optionsList}. Only 'url', 'authToken', and 'remoteEncryptionKey' are supported in the serverless compatibility layer.

What it means

The serverless compatibility client only supports three config keys - url, authToken and remoteEncryptionKey - and validateConfig() throws LibsqlError code UNSUPPORTED_CONFIG at construction time if it sees any of: encryptionKey, syncUrl, syncInterval, readYourWrites, offline, tls, intMode, fetch or concurrency. The layer maps onto the HRTB/HTTP protocol, where those options have no meaning, so it rejects them loudly instead of silently ignoring behavior you asked for.

Solutions

  1. Delete the unsupported keys from the config used in serverless deployments - the error message lists exactly which ones it saw
  2. For intMode: handle large integers yourself (BigInt(result.lastInsertRowid) etc.) instead of configuring the mode
  3. For custom fetch: rely on the runtime's global fetch (edge runtimes provide it) rather than injecting one
  4. If you genuinely need those options, run the full @libsql/client on a Node runtime instead of the serverless layer

Example fix

// before
const client = createClient({
  url: process.env.TURSO_DATABASE_URL!,
  authToken: process.env.TURSO_AUTH_TOKEN,
  intMode: 'bigint',
}); // throws UNSUPPORTED_CONFIG

// after
const client = createClient({
  url: process.env.TURSO_DATABASE_URL!,
  authToken: process.env.TURSO_AUTH_TOKEN,
});
Defensive patterns

Strategy: validation

Validate before calling

const ALLOWED = new Set(['url', 'authToken', 'remoteEncryptionKey']);
export function sanitizeConfig(cfg: Record<string, unknown>) {
  const clean: Record<string, unknown> = {};
  for (const [k, v] of Object.entries(cfg)) {
    if (ALLOWED.has(k)) clean[k] = v;
    else console.warn(`Ignoring unsupported serverless option '${k}'`);
  }
  return clean;
}
const client = createClient(sanitizeConfig(sharedConfig) as Config);

Type guard

function isSupportedConfig(cfg: Record<string, unknown>): boolean {
  return Object.keys(cfg).every(k => ['url', 'authToken', 'remoteEncryptionKey'].includes(k));
}

Prevention

When it happens

Trigger: createClient(config) with a config object written for the full @libsql/client - e.g. { url, authToken, intMode: 'bigint' } or a custom fetch function - passed to the serverless compat entry.

Common situations: Sharing one config object between a Node app (@libsql/client) and an edge/serverless deployment (this compat layer); copy-pasted snippets that set concurrency or tls; migrating older libsql config with syncUrl/offline flags left in place.

Related errors


AI-assisted analysis of tursodatabase/turso@6c72522679 (2026-08-20). Data as JSON: /api/errors/9eeda2042097bb38. Report an issue: GitHub.

Appendix: source

Thrown at serverless/javascript/src/compat.ts:212

    if (config.offline !== undefined) {
      unsupportedOptions.push({ key: 'offline', value: config.offline });
    }
    if (config.tls !== undefined) {
      unsupportedOptions.push({ key: 'tls', value: config.tls });
    }
    if (config.intMode !== undefined) {
      unsupportedOptions.push({ key: 'intMode', value: config.intMode });
    }
    if (config.fetch !== undefined) {
      unsupportedOptions.push({ key: 'fetch', value: config.fetch });
    }
    if (config.concurrency !== undefined) {
      unsupportedOptions.push({ key: 'concurrency', value: config.concurrency });
    }

    if (unsupportedOptions.length > 0) {
      const optionsList = unsupportedOptions.map(opt => `'${opt.key}'`).join(', ');
      throw new LibsqlError(
        `Unsupported configuration options: ${optionsList}. Only 'url', 'authToken', and 'remoteEncryptionKey' are supported in the serverless compatibility layer.`,
        "UNSUPPORTED_CONFIG"
      );
    }

    // Validate required options
    if (!config.url) {
      throw new LibsqlError("Missing required 'url' configuration option", "MISSING_URL");
    }
  }

  get closed(): boolean {
    return this._closed;
  }

  get protocol(): string {
    return "http";
  }

View on GitHub (pinned to 6c72522679)