#env variable undefined

1 messages · Page 1 of 1 (latest)

south thicket
#

Hey, I have a .env for my supabase url and api key. I don't want them to be displayed on the client so I didn't prefix the name with 'PUBLIC_'

when I deploy to prod, using netlify, I am getting this error on the console: Uncaught Error: supabaseUrl is required. same deal with the key as well.

did I not set up the variables properly?

Here's a link to the site and repo

https://project-proposal-ep.vercel.app/
https://github.com/edwardspresume/project_proposals

GitHub

Site so others can send me project ideas to consider building - GitHub - edwardspresume/project_proposals: Site so others can send me project ideas to consider building

fervent linden
#

Your script is being used client side inside a <script> tag, if you only want to call your API server side you have to do it in the frontmatter (---) or in an API route, here is a simple guide in the docs on how to create server side forms: https://docs.astro.build/en/recipes/build-forms/

Astro Documentation

Learn how to build HTML forms and handle submissions in your frontmatter