{"record":{"id":"9eeda2042097bb38","repo":"tursodatabase/turso","slug":"unsupported-config","errorCode":"UNSUPPORTED_CONFIG","errorMessage":"Unsupported configuration options: ${optionsList}. Only 'url', 'authToken', and 'remoteEncryptionKey' are supported in the serverless compatibility layer.","messagePattern":"Unsupported configuration options: (.+?)\\. Only 'url', 'authToken', and 'remoteEncryptionKey' are supported in the serverless compatibility layer\\.","errorType":"exception","errorClass":"LibsqlError","httpStatus":null,"severity":"error","filePath":"serverless/javascript/src/compat.ts","lineNumber":215,"sourceCode":"    if (config.offline !== undefined) {\n      unsupportedOptions.push({ key: 'offline', value: config.offline });\n    }\n    if (config.tls !== undefined) {\n      unsupportedOptions.push({ key: 'tls', value: config.tls });\n    }\n    if (config.intMode !== undefined) {\n      unsupportedOptions.push({ key: 'intMode', value: config.intMode });\n    }\n    if (config.fetch !== undefined) {\n      unsupportedOptions.push({ key: 'fetch', value: config.fetch });\n    }\n    if (config.concurrency !== undefined) {\n      unsupportedOptions.push({ key: 'concurrency', value: config.concurrency });\n    }\n\n    if (unsupportedOptions.length > 0) {\n      const optionsList = unsupportedOptions.map(opt => `'${opt.key}'`).join(', ');\n      throw new LibsqlError(\n        `Unsupported configuration options: ${optionsList}. Only 'url', 'authToken', and 'remoteEncryptionKey' are supported in the serverless compatibility layer.`,\n        \"UNSUPPORTED_CONFIG\"\n      );\n    }\n\n    // Validate required options\n    if (!config.url) {\n      throw new LibsqlError(\"Missing required 'url' configuration option\", \"MISSING_URL\");\n    }\n  }\n\n  get closed(): boolean {\n    return this._closed;\n  }\n\n  get protocol(): string {\n    return \"http\";\n  }","sourceCodeStart":197,"sourceCodeEnd":233,"githubUrl":"https://github.com/tursodatabase/turso/blob/bad083fafbefdeae9a42ec19bdaaad8918dcf411/serverless/javascript/src/compat.ts#L197-L233","documentation":"The serverless JavaScript compatibility layer (createClient shim in serverless/javascript/src/compat.ts) validates the config in its constructor and only accepts url, authToken, and remoteEncryptionKey. Passing any of encryptionKey, syncUrl, syncInterval, readYourWrites, offline, tls, intMode, fetch, or concurrency throws a LibsqlError with code 'UNSUPPORTED_CONFIG' listing the offending keys. It fails fast at client construction, before any network call.","triggerScenarios":"createClient({ url, authToken, intMode: 'bigint' }) copied from @libsql/client code; passing a custom fetch or concurrency (common in libsql client configs); copying embedded-replica options (syncUrl, offline, readYourWrites) from the native sync SDK's connect() call into the compat layer's createClient().","commonSituations":"Porting an existing @libsql/client app to the serverless compat layer; config objects shared between the sync SDK and the serverless client; TypeScript configs built for the wider libsql Config type being reused here.","solutions":["Remove the listed unsupported keys — keep only url, authToken, and remoteEncryptionKey","For intMode: convert BigInt values manually after reads instead of configuring integer mode","For custom fetch/proxy needs: use the full @libsql/client package instead of this compatibility layer","For embedded-replica/sync features (syncUrl, offline): use the sync SDK's connect(), not this compat layer"],"exampleFix":"// before\nconst client = createClient({\n  url: 'libsql://my-db.turso.io',\n  authToken: token,\n  syncUrl: 'https://sync.example.com',\n  intMode: 'number',\n  concurrency: 5,\n}); // LibsqlError: Unsupported configuration options: 'syncUrl', 'intMode', 'concurrency'\n\n// after\nconst client = createClient({\n  url: 'libsql://my-db.turso.io',\n  authToken: token,\n});","handlingStrategy":"validation","validationCode":"const SUPPORTED = new Set(['url', 'authToken', 'remoteEncryptionKey']);\n\nfunction toCompatConfig(config: Record<string, unknown>) {\n  const unsupported = Object.keys(config).filter(k => !SUPPORTED.has(k) && config[k] !== undefined);\n  if (unsupported.length > 0) {\n    throw new Error(`This layer ignores: ${unsupported.join(', ')} — dropping them`);\n  }\n  return config as { url: string; authToken?: string; remoteEncryptionKey?: string };\n}","typeGuard":"function isSupportedCompatConfig(c: object): c is { url: string; authToken?: string; remoteEncryptionKey?: string } {\n  const allowed = ['url', 'authToken', 'remoteEncryptionKey'];\n  return Object.keys(c).every(k => allowed.includes(k));\n}","tryCatchPattern":"try {\n  client = createClient(rawConfig);\n} catch (e) {\n  if ((e as { code?: string }).code === 'UNSUPPORTED_CONFIG') {\n    const { url, authToken, remoteEncryptionKey, ...rest } = rawConfig;\n    console.warn('dropped unsupported options:', Object.keys(rest));\n    client = createClient({ url, authToken, remoteEncryptionKey });\n  } else throw e;\n}","preventionTips":["Restrict compat-layer configs to url, authToken, remoteEncryptionKey by construction (a typed factory)","Don't share one config object between the sync SDK and this compat layer — their option sets differ","Handle BigInt conversion in app code instead of passing intMode","Check the LibsqlError code field: UNSUPPORTED_CONFIG means config shape, not connectivity"],"tags":["configuration","compat-layer","libsql-client","serverless"],"backgroundTag":"unsupported-config-option","analyzedSha":"bad083fafbefdeae9a42ec19bdaaad8918dcf411","analyzedAt":"2026-08-16T23:12:11.798Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}