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
Hey, can you share more details? A repo to reproduce this would be really helpful
https://github.com/mdabir1203/BanglaPrompt.ai
try this one out
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...
Also this website : banglaprompt-ai.pages.dev/
@harshil1712
Can you please point to the exact code where you are referencing the URL?
Here is my supabase client configutation and the whole url is defined as env variable inside cloudflare pages / workers settings
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.
So how you propose to make my design better ?