I have a project created with Vite that uses Nuxt.
Within the script, I want to use useSupabaseClient(), but I'm getting an "is not defined" error.
The dependency @nuxtjs/supabase is installed and up to date. I believe the issue is in the import, but the module is already imported in nuxt.config.js.
Auth.vue
<script setup>
const client = useSupabaseClient()
const user = useSupabaseUser()
const login = async (prov) => {
const { data, error } = await client.auth.signInWithOAuth({
provider: prov,
})
console.log(data, error)
}
</script>
Nuxt.config.js
export default defineNuxtConfig({
pages: true,
modules: [
'nuxt-icon',
'nuxt-lodash',
'@pinia/nuxt',
'@pinia-plugin-persistedstate/nuxt',
'@nuxtjs/tailwindcss',
'@nuxtjs/supabase'
],
}