{"record":{"id":"7942dcffbc668671","repo":"tursodatabase/turso","slug":"missing-url","errorCode":"MISSING_URL","errorMessage":"Missing required 'url' configuration option","messagePattern":"Missing required 'url' configuration option","errorType":"exception","errorClass":"LibsqlError","httpStatus":null,"severity":"error","filePath":"serverless/javascript/src/compat.ts","lineNumber":220,"sourceCode":"    }\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  }\n\n  private normalizeStatement(stmt: InStatement): { sql: string; args: any[] } {\n    if (typeof stmt === 'string') {\n      return { sql: stmt, args: [] };\n    }\n    \n    const args = stmt.args || [];\n    if (Array.isArray(args)) {","sourceCodeStart":202,"sourceCodeEnd":238,"githubUrl":"https://github.com/tursodatabase/turso/blob/6c7252267988c76e632af00a671e4b9788dfae13/serverless/javascript/src/compat.ts#L202-L238","documentation":"validateConfig() requires a truthy url; after the unsupported-options check, a config with no url (undefined, null or empty string) throws LibsqlError code MISSING_URL at createClient() time. The serverless client is remote-only, so the URL is the one piece of configuration it cannot operate without.","triggerScenarios":"createClient({}) or createClient({ authToken }) with the url key absent; url sourced from an environment variable that is not set in the deployed environment, yielding undefined or ''.","commonSituations":"TURSO_DATABASE_URL not configured in Vercel/Cloudflare/Netlify for the preview or production environment while it exists locally; typo'd variable name; deploying before wiring secrets.","solutions":["Set the url option from the environment (e.g. libsql://mydb-myorg.turso.io) and confirm the variable exists in every deploy environment","Fail fast at cold start: check process.env.TURSO_DATABASE_URL and throw a descriptive error before createClient","Use platform-correct env access (process.env on Vercel/Node, env bindings on Cloudflare Workers) rather than assuming Node semantics"],"exampleFix":"// before\nconst client = createClient({\n  url: process.env.TURSO_DATABASE_URL, // undefined in prod\n  authToken: process.env.TURSO_AUTH_TOKEN,\n});\n\n// after\nconst url = process.env.TURSO_DATABASE_URL;\nif (!url) {\n  throw new Error('TURSO_DATABASE_URL is not set - configure it for this environment');\n}\nconst client = createClient({ url, authToken: process.env.TURSO_AUTH_TOKEN });","handlingStrategy":"validation","validationCode":"const url = process.env.TURSO_DATABASE_URL;\nif (!url) {\n  throw new Error('TURSO_DATABASE_URL is not set - add it to this environment (Vercel/Cloudflare/Netlify)');\n}\nconst client = createClient({ url, authToken: process.env.TURSO_AUTH_TOKEN });","typeGuard":"function hasDatabaseUrl(url: string | undefined): url is string {\n  return typeof url === 'string' && url.length > 0;\n}","tryCatchPattern":null,"preventionTips":["Fail fast at cold start on missing env vars rather than inside createClient","Verify env vars exist in preview and production environments, not just local","Use the platform's env mechanism (Workers env bindings vs process.env) correctly"],"tags":["serverless","configuration","url","env-vars","validation"],"backgroundTag":"missing-database-url","analyzedSha":"6c7252267988c76e632af00a671e4b9788dfae13","analyzedAt":"2026-08-20T07:02:18.389Z","contentChangedAt":"2026-08-20T07:02:18.389Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}