My React+VIte+Supabase project not loading the env for the Supabase.

We deployed our project properly and then not able to load the env even though configured facing this issue : vendor-CqAJ87w5.js:40 Error: Environment variable "SUPABASE_URL" is not defined at c (client-CajlnNqu.js:1:986) at client-CajlnNqu.js:1:1045 index-BxSvOkTk.js:2 01:21:51 [ERROR] Unhandled runtime error Object vendor-CqAJ87w5.js:40 Uncaught Error: Environment variable "SUPABASE_URL" is not defined at c (client-CajlnNqu.js:1:986) at client-CajlnNqu.js:1:1045 Help us fix it
7 Replies
harshil1712
harshil17123w ago
Hey, can you share more details? A repo to reproduce this would be really helpful
Ab1r
Ab1rOP3w ago
GitHub
GitHub - mdabir1203/BanglaPrompt.ai: A Bangla-first AI prompt selli...
A Bangla-first AI prompt selling and creator platform built with React, Vite and Supabase. The project showcases production-ready patterns for scaling, security and monetization while teaching prom...
Ab1r
Ab1rOP3w ago
Also this website : banglaprompt-ai.pages.dev/ @harshil1712
harshil1712
harshil17123w ago
Can you please point to the exact code where you are referencing the URL?
Ab1r
Ab1rOP3w ago
Here is my supabase client configutation and the whole url is defined as env variable inside cloudflare pages / workers settings
harshil1712
harshil17122w ago
This configuration file looks fine to me. What I am trying to understand is where exactly you are trying to access the env variable in your code? Is that on the client or the server? If it's on the client, this is expected. Your client doesn't have access to the value, for security reasons.
Ab1r
Ab1rOP4d ago
So how you propose to make my design better ?

Did you find this page helpful?