-
Hi =) Whenever building, im getting this error: error during build:
RollupError: src/routes/+layout.ts (1:35): "PUBLIC_SUPABASE_URL" is not exported by "virtual:$env/static/public", imported by "src/routes/+layout.ts". The referenced part of the file looks like this: import { PUBLIC_SUPABASE_ANON_KEY, PUBLIC_SUPABASE_URL } from '$env/static/public';
import { createSupabaseLoadClient } from '@supabase/auth-helpers-sveltekit';
import { getAvatarUrl } from '$lib/utils';
export const load = async ({ fetch, data, depends }) => {
depends('supabase:auth');
const supabase = createSupabaseLoadClient({
supabaseUrl: PUBLIC_SUPABASE_URL,
supabaseKey: PUBLIC_SUPABASE_ANON_KEY,
event: { fetch },
serverSession: data.session
}); Does anyone have an idea? Im pretty stuck right now, and already tried a ton to fix it. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
i have the same problem i still dont know why, my .env.local looks fine |
Beta Was this translation helpful? Give feedback.
-
Hello, I'm encountering the same error today, although I have added the env variables manually inside Vercel - like I've done in countless projects in the past :/ |
Beta Was this translation helpful? Give feedback.
-
+1, but with GCP Cloud Run. Env variables also set within GCP. |
Beta Was this translation helpful? Give feedback.
I actually managed to fix it. I don't remember exactly what I did, but I think you have to add the env inside vercel manually.