# Secrets manager failing build?

**URL:** <https://answers.netlify.com/t/secrets-manager-failing-build/141886>\
**Category:** Support\
**Tags:** building\
**Created:** [March 12, 2025, 3:18am UTC](https://answers.netlify.com/t/secrets-manager-failing-build/141886 "2025-03-12T03:18:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kael\_Broersma](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/kael_broersma/32/67688_2.png) [@Kael\_Broersma](https://answers.netlify.com/u/Kael_Broersma)\
**Post date:** [March 12, 2025, 3:18am UTC](https://answers.netlify.com/t/secrets-manager-failing-build/141886/1 "2025-03-12T03:18:18Z")

</div>

Hello, I am currently building a website on bolt.new, exporting to github and deploying through netlify so I can use functions, etc.

I have all of my env variables set through netlify- none in my code. I have attempted any env processing calls to netlify functions, however, my API keys are still being leaked into my build folder.

Even API keys that I do not have set to be processed inside of my code is being logged into my dist/assets html files.

Basically, every env file I have configured as a secret is being published to my build… even though I don’t reference a few of them. Why is this?

Thank you.

---

<div class="post-metadata">

**Author:** ![Kael\_Broersma](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/kael_broersma/32/67688_2.png) [@Kael\_Broersma](https://answers.netlify.com/u/Kael_Broersma)\
**Post date:** [March 12, 2025, 4:07am UTC](https://answers.netlify.com/t/secrets-manager-failing-build/141886/2 "2025-03-12T04:07:00Z")

</div>

Update; I have figured out that it was leaking them as my ENV files had the prefix “VITE\_”

However, now it is only the env variables that are processed within my code that is leaked. Help! Lol.

---

<div class="post-metadata">

**Author:** ![Kael\_Broersma](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/kael_broersma/32/67688_2.png) [@Kael\_Broersma](https://answers.netlify.com/u/Kael_Broersma)\
**Post date:** [March 12, 2025, 4:48am UTC](https://answers.netlify.com/t/secrets-manager-failing-build/141886/3 "2025-03-12T04:48:07Z")

</div>

SOLVED!

For users experiencing this issue- first, view my above text.  
Secondly, ensure that you are not using process.env in any file in your front-end code.  
Pass every instance where you must use your secret credentials to your netlify functions

Saying this now, I feel braindead. But a few overlooked files in a large project will completely throw your security off!

Cheers!
