Hi, does anyone have a quick fix or best practice for creating an app with Supabase backend, including authentication, so that I can access all pages within the app in the v0 preview environment? I cannot login while in the preview environment because there is a failure in initialising the Supabase code so I cannot see any changes made by the LLM until I deploy to the public environment. Obviously I don’t want to deploy every time the LLM is prompted to make changes to the code. Sorry if this is a really basic question.
I can login but was never able to create a full back=end with SupaBase or anything else that requires env. I don’t understand what’s the point of the enviroment information being provided to v0 is it cannot use it in the preview mode. Also, on the videos about v0 they clearly show that SupaBase being used exactly in preview mode. Seems like a fraud so far, because it is not possible to create a fully working website with backend integration with v0 only.
I think in the end I made sure the credentials were available to all the environments: development, production, etc. Go to the main Vercel settings (not v0 settings) and ensure that the env vars are permitted for use by all environments. That fixed the issue for me, if I remember rightly.
Hi there, the environment variables work in the on screen preview section of v0 interface. However, they don’t work in the Open in new tab feature because of security constraints. It’s a known limitation.
Let us know if you’re facing issues with Supabase in the on screen preview section and we’ll be happy to assist.
I made available the credential to all the environments but its still not working on preview section. Any suggestion?
Hi @mateo-6135, welcome to the Vercel Community!
The reason is same as shared above:
Hey! Yes, im having issues on the screen preview section. I think the issue comes from not persisting the cookies and the session id. The steps I follow are the following:
- Log in with an existing user
- Redirects to the app
- Immediately redirects to log in with the below error in loop
Any solution?
TypeError: Failed to fetch
at o (https://preview-loop-web-platform-kzmjjj60k3ziihfceqff.vusercontent.net/\_next/static/chunks/7329-70683bec8609aa05.js?dpl=dpl_B2sDurf1KEmnPDGJKMGGM9YvUhUT:1:26110)
at t (https://preview-loop-web-platform-kzmjjj60k3ziihfceqff.vusercontent.net/\_next/static/chunks/7329-70683bec8609aa05.js?dpl=dpl_B2sDurf1KEmnPDGJKMGGM9YvUhUT:1:29455)
at e.**v0**.globalThis.fetch (https://preview-loop-web-platform-kzmjjj60k3ziihfceqff.vusercontent.net/\_next/static/chunks/7329-70683bec8609aa05.js?dpl=dpl_B2sDurf1KEmnPDGJKMGGM9YvUhUT:1:29967)
at async ut (https://esm.v0.dev/@supabase/auth-js@2.71.1/es2022/auth-js.mjs:3:8950)
at async f (https://esm.v0.dev/@supabase/auth-js@2.71.1/es2022/auth-js.mjs:3:8755)
at async https://esm.v0.dev/@supabase/auth-js@2.71.1/es2022/auth-js.mjs:4:8924
at async m.\_useSession (https://esm.v0.dev/@supabase/auth-js@2.71.1/es2022/auth-js.mjs:4:6923)
at async m.\_getUser (https://esm.v0.dev/@supabase/auth-js@2.71.1/es2022/auth-js.mjs:4:8718)
at async https://esm.v0.dev/@supabase/auth-js@2.71.1/es2022/auth-js.mjs:4:8581
at async ut (@supabase/auth-js)
at async f (@supabase/auth-js)
at async m.\_useSession (@supabase/auth-js)
If it is on the same screen preview section then most likely related to the app logic itself. I’d suggest you to fork the chat and in the new chat ask v0 to fix it with the explanation you gave to me.