Can't use module in .vue file
So i've installed
npm i @nuxtjs/supabase
and added it into the nuxt config. I know its working since the project url error is showing / solving when I add the url to my project. But i can't use this model in my .vue files. I try to use the useSupabaseClient but in my project it says undefined
In vscode it doesn't show up in emmet abriviation and if I hover over it, it says any
13 Replies
Hi, can you show us how you’ve installed the module? Your nuxt config, your package.json, etc 🙂 thanks
I've installed it with
npm i @nuxtjs/supabase
package.json:
nuxt config:
And im using it like:Have you added this to your
.env
:
Otherwise, can you remove your .nuxt folder and package-lock and reinstall dependencies?Yes I have it
Will try it when i'm at home
still not working
And in which place are you trying to use
useSupabaseClient
?
Cannot see any issue in your config
Maybe you can show an implementation example thats not workingso I have a file
pages/login.vue
and in there im just trying to implement it: In .nuxt/types I found a file that is called supabase.d.ts and it
declare module '#supabase/server'
with a slightly different name. If i try to use this one it adds a line to my code: import { serverSupabaseClient } from '#supabase/server';
. This causes the error:
yeah this is only for usage inside server/ files
oh okay
It's strange since also your client implementation looks fine
Can you create a minimal reproduction? https://nuxt.com/docs/community/reporting-bugs#create-a-minimal-reproduction
Nuxt
Reporting Bugs
One of the most valuable roles in open source is taking the time to report bugs helpfully.
yes
I tried it also with a new project of nuxt3, just installed supabase without anything else and it is still not working
reproduktion works fine
looks like an issue with my machine
Okay, let me know if you were able to resolve it