Cannot read from database in next.js page

When trying to access the data from supabase, I get thrown this error There was an error: TypeError: Cannot read properties of undefined (reading 'from'). when trying to do:

const { data, error } = await supabase
  .from('clips')
  .select('url')


That's the first issue, the second is having a lot of trouble being able to grab data from the db within a next.js page, probably because of the above issue, but what would the best way to approach this be? Make the async call within useEffect()? or is there some better way I'm not seeing or found online. Any help would be amazing
Was this page helpful?