While deploying my web app on streamlit cloud, facing error- “KeyError: 'st.secrets has no key “DETA_KEY”. Did you forget to add it to secrets.toml or the app settings on Streamlit Cloud?”
But I have already defined the environment variable in the secrets in streamlit cloud. So why am I seeing this error?
I suspect the error is because you’ve incorrectly included the theme config in secrets. So the app is currently looking for st.secrets['DETA_KEY'], but the secrets are actually in st.secrets['theme']['DETA_KEY'] instead.
Could you try removing the theme section, reboot your app, and see if that helps?