{"record":{"id":"4ba6e83108d63b63","repo":"eyaltoledano/claude-task-master","slug":"config-missing","errorCode":"CONFIG_MISSING","errorMessage":"Supabase configuration missing. Please set TM_SUPABASE_URL and TM_SUPABASE_ANON_KEY (runtime) or TM_PUBLIC_SUPABASE_URL and TM_PUBLIC_SUPABASE_ANON_KEY (build-time) environment variables.","messagePattern":"Supabase configuration missing\\. Please set TM_SUPABASE_URL and TM_SUPABASE_ANON_KEY \\(runtime\\) or TM_PUBLIC_SUPABASE_URL and TM_PUBLIC_SUPABASE_ANON_KEY \\(build-time\\) environment variables\\.","errorType":"error_code","errorClass":"AuthenticationError","httpStatus":null,"severity":"critical","filePath":"packages/tm-core/src/modules/integration/clients/supabase-client.ts","lineNumber":72,"sourceCode":"\t\t}\n\t\tSupabaseAuthClient.instance = null;\n\t}\n\n\t/**\n\t * Get Supabase client with proper session management\n\t */\n\tgetClient(): SupabaseJSClient {\n\t\tif (!this.client) {\n\t\t\t// Get Supabase configuration from environment\n\t\t\t// Runtime vars (TM_*) take precedence over build-time vars (TM_PUBLIC_*)\n\t\t\tconst supabaseUrl =\n\t\t\t\tprocess.env.TM_SUPABASE_URL || process.env.TM_PUBLIC_SUPABASE_URL;\n\t\t\tconst supabaseAnonKey =\n\t\t\t\tprocess.env.TM_SUPABASE_ANON_KEY ||\n\t\t\t\tprocess.env.TM_PUBLIC_SUPABASE_ANON_KEY;\n\n\t\t\tif (!supabaseUrl || !supabaseAnonKey) {\n\t\t\t\tthrow new AuthenticationError(\n\t\t\t\t\t'Supabase configuration missing. Please set TM_SUPABASE_URL and TM_SUPABASE_ANON_KEY (runtime) or TM_PUBLIC_SUPABASE_URL and TM_PUBLIC_SUPABASE_ANON_KEY (build-time) environment variables.',\n\t\t\t\t\t'CONFIG_MISSING'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Create client with custom storage adapter (similar to React Native AsyncStorage)\n\t\t\tthis.client = createClient(supabaseUrl, supabaseAnonKey, {\n\t\t\t\tauth: {\n\t\t\t\t\tstorage: this.sessionStorage,\n\t\t\t\t\tautoRefreshToken: true,\n\t\t\t\t\tpersistSession: true,\n\t\t\t\t\tdetectSessionInUrl: false\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\treturn this.client;\n\t}","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/packages/tm-core/src/modules/integration/clients/supabase-client.ts#L54-L90","documentation":"SupabaseClient.getClient() throws AuthenticationError with code CONFIG_MISSING when neither the runtime env vars (TM_SUPABASE_URL, TM_SUPABASE_ANON_KEY) nor the build-time ones (TM_PUBLIC_SUPABASE_URL, TM_PUBLIC_SUPABASE_ANON_KEY) are set. Without them no Supabase client can be constructed.","triggerScenarios":"Any call that reaches getClient() (auth operations, sign-in, code exchange) in a process where none of the four environment variables is defined.","commonSituations":"Running the CLI locally without a .env file, CI environments missing secrets, deploying without configuring env vars, or using the wrong variable prefix for the environment (runtime vs build-time).","solutions":["Export TM_SUPABASE_URL and TM_SUPABASE_ANON_KEY in the current shell or .env file","For build-time contexts set TM_PUBLIC_SUPABASE_URL and TM_PUBLIC_SUPABASE_ANON_KEY instead","Verify with 'echo $TM_SUPABASE_URL' that the values are visible to the process and restart it after adding them"],"exampleFix":"// before\n# .env (missing)\n// after\n# .env\nTM_SUPABASE_URL=https://your-project.supabase.co\nTM_SUPABASE_ANON_KEY=your-anon-key","handlingStrategy":"validation","validationCode":"const url = process.env.TM_SUPABASE_URL ?? process.env.TM_PUBLIC_SUPABASE_URL;\nconst key = process.env.TM_SUPABASE_ANON_KEY ?? process.env.TM_PUBLIC_SUPABASE_ANON_KEY;\nif (!url || !key) {\n  // fail fast with a setup hint before calling any auth API\n}","typeGuard":"function hasSupabaseConfig(): boolean {\n  return Boolean(\n    (process.env.TM_SUPABASE_URL ?? process.env.TM_PUBLIC_SUPABASE_URL) &&\n    (process.env.TM_SUPABASE_ANON_KEY ?? process.env.TM_PUBLIC_SUPABASE_ANON_KEY)\n  );\n}","tryCatchPattern":"try {\n  await supabaseClient.signInWithPKCE();\n} catch (e) {\n  if (e instanceof AuthenticationError && e.code === 'CONFIG_MISSING') {\n    console.error('Set TM_SUPABASE_URL and TM_SUPABASE_ANON_KEY, then retry.');\n  }\n}","preventionTips":["Commit a .env.example listing all required TM_ variables","Validate env vars at CLI startup before any network calls","Document runtime vs TM_PUBLIC_ build-time variables in your deployment setup"],"tags":["configuration","environment-variables","supabase","auth"],"backgroundTag":"missing-env-var","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}