Environment variable not working

I recently deployed my website with the FLEXY_FORM_ID (using FlexyForm) environment variable on Netlify, but when I submit my form, it goes to an undefined link and doesn’t read my environment variable. However, when I test it on my local machine, it works 100% with no problems.

Would you guys know what I have to do to fix the problem on the production link? Thank you!

I fixed the problem by adding GATSBY_ in as a prefix to FLEXY_FORM_ID (i.e. GATSBY_FLEXY_FORM_ID). I learned from this Stack Overflow post that I need to tag on the GATSBY_ in order for any client-side environmental variables to work in a GatsbyJS project!

1 Like