eyaltoledano/claude-task-master · critical · AuthenticationError

CONFIG_MISSING

CONFIG_MISSING

Error message

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.

What it means

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.

Source

Thrown at packages/tm-core/src/modules/integration/clients/supabase-client.ts:72

		}
		SupabaseAuthClient.instance = null;
	}

	/**
	 * Get Supabase client with proper session management
	 */
	getClient(): SupabaseJSClient {
		if (!this.client) {
			// Get Supabase configuration from environment
			// Runtime vars (TM_*) take precedence over build-time vars (TM_PUBLIC_*)
			const supabaseUrl =
				process.env.TM_SUPABASE_URL || process.env.TM_PUBLIC_SUPABASE_URL;
			const supabaseAnonKey =
				process.env.TM_SUPABASE_ANON_KEY ||
				process.env.TM_PUBLIC_SUPABASE_ANON_KEY;

			if (!supabaseUrl || !supabaseAnonKey) {
				throw new AuthenticationError(
					'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.',
					'CONFIG_MISSING'
				);
			}

			// Create client with custom storage adapter (similar to React Native AsyncStorage)
			this.client = createClient(supabaseUrl, supabaseAnonKey, {
				auth: {
					storage: this.sessionStorage,
					autoRefreshToken: true,
					persistSession: true,
					detectSessionInUrl: false
				}
			});
		}

		return this.client;
	}

View on GitHub (pinned to c0c98d367c)

Solutions

  1. Export TM_SUPABASE_URL and TM_SUPABASE_ANON_KEY in the current shell or .env file
  2. For build-time contexts set TM_PUBLIC_SUPABASE_URL and TM_PUBLIC_SUPABASE_ANON_KEY instead
  3. Verify with 'echo $TM_SUPABASE_URL' that the values are visible to the process and restart it after adding them

Example fix

// before
# .env (missing)
// after
# .env
TM_SUPABASE_URL=https://your-project.supabase.co
TM_SUPABASE_ANON_KEY=your-anon-key
Defensive patterns

Strategy: validation

Validate before calling

const url = process.env.TM_SUPABASE_URL ?? process.env.TM_PUBLIC_SUPABASE_URL;
const key = process.env.TM_SUPABASE_ANON_KEY ?? process.env.TM_PUBLIC_SUPABASE_ANON_KEY;
if (!url || !key) {
  // fail fast with a setup hint before calling any auth API
}

Type guard

function hasSupabaseConfig(): boolean {
  return Boolean(
    (process.env.TM_SUPABASE_URL ?? process.env.TM_PUBLIC_SUPABASE_URL) &&
    (process.env.TM_SUPABASE_ANON_KEY ?? process.env.TM_PUBLIC_SUPABASE_ANON_KEY)
  );
}

Try / catch

try {
  await supabaseClient.signInWithPKCE();
} catch (e) {
  if (e instanceof AuthenticationError && e.code === 'CONFIG_MISSING') {
    console.error('Set TM_SUPABASE_URL and TM_SUPABASE_ANON_KEY, then retry.');
  }
}

Prevention

When it happens

Trigger: Any call that reaches getClient() (auth operations, sign-in, code exchange) in a process where none of the four environment variables is defined.

Common situations: 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).

Understand the failure class

Background: "environment variable is not set" and "Missing keys in environment" errors: what missing required env var messages mean and how to fix them — this error's family across 28 libraries.

Related errors


AI-assisted analysis of eyaltoledano/claude-task-master@c0c98d367c (2026-08-29). Data as JSON: /api/errors/4ba6e83108d63b63. Report an issue: GitHub.