supabase-community / nuxt3-quickstarter

13 stars 13 forks source link

useSupabaseUser is not defined #11

Open AlexRodwell opened 2 years ago

AlexRodwell commented 2 years ago

Bug report

When pulling and running the repository locally, and following the Supabase Nuxt3 guide (setting up project, SQL query and creating a .env with required credentials), I continually get a 500 useSupabaseUser is not defined error thrown. Additionally, it appears none of the @nuxtjs/supabase functions are available, as if I remove the previous error, it also occurs on useSupabaseClient().

@nuxtjs/supabse is defined in the nuxt.config.ts below (same as repo file), so unsure what is causing this issue as it has been imported into the Nuxt project for use.

import { defineNuxtConfig } from 'nuxt'

// https://v3.nuxtjs.org/api/configuration/nuxt.config
export default defineNuxtConfig({
  modules: ['@nuxtjs/supabase'],
  css: ['@/assets/main.css'],
})

Error log:

at setup (/F:/supabase/nuxt-user-management/.nuxt/dist/server/server.mjs:9265:18)
at _sfc_main.setup (/F:/supabase/nuxt-user-management/.nuxt/dist/server/server.mjs:9312:23)
at callWithErrorHandling (F:\supabase\nuxt-user-management\node_modules\@vue\runtime-core\dist\runtime-core.cjs.js:157:22)
at setupStatefulComponent (F:\supabase\nuxt-user-management\node_modules\@vue\runtime-core\dist\runtime-core.cjs.js:7135:29)
at setupComponent (F:\supabase\nuxt-user-management\node_modules\@vue\runtime-core\dist\runtime-core.cjs.js:7090:11)
at renderComponentVNode (F:\supabase\nuxt-user-management\node_modules\@vue\server-renderer\dist\server-renderer.cjs.js:172:17)
at Module.ssrRenderComponent (F:\supabase\nuxt-user-management\node_modules\@vue\server-renderer\dist\server-renderer.cjs.js:612:12)
at _sfc_ssrRender (/F:/supabase/nuxt-user-management/.nuxt/dist/server/server.mjs:8971:33)
at renderComponentSubTree (F:\supabase\nuxt-user-management\node_modules\@vue\server-renderer\dist\server-renderer.cjs.js:254:17)
at renderComponentVNode (F:\supabase\nuxt-user-management\node_modules\@vue\server-renderer\dist\server-renderer.cjs.js:188:16)

Unless there is a node version difference, I'm not quite sure what's causing this. Just wanted to quickly demo Supabase without much hassle using my preferred JS framework, but thought I'd report this in case anyone else was having the same issue. I wouldn't be surprised if it's something obvious I'm missing though.

System information

dshukertjr commented 2 years ago

Thanks for opening this issue. Will look into this.