N
Nuxt6mo ago
Mac9

Environment Variables are unusable but are able to be logged

I am trying to connect to a Supabase instance, I can run console.log on the environment variables and see the logs in the console are correct. However when I try to run createClient I recieve a 500: supabaseUrl is required error.
import { createClient } from "@supabase/supabase-js";

const { supabaseUrl, supabaseKey } = useRuntimeConfig();
console.log(supabaseUrl, supabaseKey)

const supabase = createClient(supabaseUrl, supabaseKey);
import { createClient } from "@supabase/supabase-js";

const { supabaseUrl, supabaseKey } = useRuntimeConfig();
console.log(supabaseUrl, supabaseKey)

const supabase = createClient(supabaseUrl, supabaseKey);
1 Reply
Mac9
Mac9OP6mo ago
I tried setting it up again and did so via the Nuxt Module this time and it worked pretty much on install and definition of the variables in .env I'll make sure to do it that way next time.
Want results from more Discord servers?
Add your server