Why is Google Gemini asking for Application default credentials if I have an API key?

I made an electron app that uses the Gemini API key. In development, it works perfectly fine with the API key. However, once I use electron-packager to package it for distribution, it starts throwing the following error:
Error: Could not load the default credentials. Browse to https://cloud.google.com/docs/authentication/getting-started for more information.

Here is the code I used to load my API key:
const API_KEY = process.env.API_KEY;

To re-iterate, the API key works just fine prior to packaging. It’s only after packaging that Gemini starts asking for ADC. According to this page, I shouldn’t need ADC if I have an API key, so why is this happening?

Here is a screenshot for an example:

Hey @Ishan_Roychowdhury
Could you please confirm if you have initialized gcloud CLI.
If not please follow the steps mentioned here.
You can even use dotenv to store the environment variables.
Please let us know if the above information helps.
Thank you!