const fs = require('fs'); const path = require('path'); // Load .env.local manually const envPath = path.join(__dirname, '..', '.env.local'); console.log('Loading from:', envPath); console.log('File exists:', fs.existsSync(envPath)); if (fs.existsSync(envPath)) { const envContent = fs.readFileSync(envPath, 'utf8'); console.log('\nFile content length:', envContent.length); console.log('First 200 chars:', envContent.substring(0, 200)); envContent.split('\n').forEach((line, idx) => { const trimmed = line.trim(); console.log(`Line ${idx}: "${trimmed.substring(0, 50)}"`); const match = trimmed.match(/^([^=:#]+)=(.*)$/); if (match) { const key = match[1].trim(); const value = match[2].trim(); console.log(` -> Matched: ${key} = ${value.substring(0, 20)}...`); if (!process.env[key]) { process.env[key] = value; } } else if (trimmed && !trimmed.startsWith('#')) { console.log(' -> No match!'); } }); } console.log('\nFinal env vars:'); console.log('NEXT_PUBLIC_SUPABASE_URL:', process.env.NEXT_PUBLIC_SUPABASE_URL); console.log('NEXT_PUBLIC_SUPABASE_ANON_KEY:', process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY ? 'SET' : 'NOT SET');