Hello there! I am hosting my personal portfolio site on S3, and I’m building it with Gatsby. I’ve chosen S3 as my hosting option on Gatsby Cloud. I’ve also added some environment variables (in both .env.* and Gatsby Cloud) that I need once the build finishes. It works great in development, but when logging these variables on production after Gatsby Cloud finishes a build, they are all undefined.
If I ignore Gatsby Cloud and build and deploy with npm to S3 directly, the environment variables are found.
I have also added a Cloudfront invalidation on GCloud for /* (everything).
I still can’t locate your account. Please supply your slug… this is available in the Netlify UI at Team settings > General > Team details > Team information .
Thanks for following up! Can you clarify what you mean by needing the environment variables “once the build finishes?”
If you want to access the environment variables in the browser, you’d need to add the GATSBY_ prefix as described here: Environment Variables | Gatsby. Let me know if this helps!
Thanks again for following up and providing that context! I reached out an internal ticket to take a closer look into this, as we’ll likely need a bit more info on how these environment variables are configured.