-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot find name 'useSupabaseClient' #326
Comments
Remove your depedency "@supabase/supabase-js", why have you both, this an "@nuxtjs/..."? For readability I would suggest, you define supabase in your nuxt.config outside like this: Now to the more important part. Did you configure your runtime environment correctly in your nuxt.config, as well are you using your supabase keys correctly? Add this to your nuxt.config: And here my .env file: Here, the public is the public key, and the service key is the one with "service_rolesecret" which bypasses role security, so choose to your needs, which one you want to use later, only public anon or service key. Then you should be able to just use: Now delete you lockfile and node_modules, install again (just to start clean with npm i or yarn ;)) and you should be good to go. |
Thanks @Shooteger for the update. I did exactly as you indicated but the error is still the same. |
I'm kinda on the same boat. The |
I can't tell why, but putting the |
Version
@nuxtjs/supabase: v1.1.5
nuxt: v3.9.0
Description
When I run
npm run dev
I get the following error message on the page in the browser;Below is some additional information.
package.json
nuxt.config.ts
My .env file has the correct Supabase credentials
.env
app.vue
default.vue
I did the following;
The line with
const client = useSupabaseClient()
(in both the app.vue and default.vue pages) is producing the error messageCannot find name 'useSupabaseClient'
in the vs code editor.The text was updated successfully, but these errors were encountered: