title: Firebase functions deploy using GOOGLE_APPLICATION_CREDENTIALS failing to get an environment config on global scope
body: <p>I'm using a <a href="https://github.com/firebase/firebase-tools#general" rel="nofollow noreferrer">Service Account authentication</a> for deploying my firebase functions (using the <code>GOOGLE_APPLICATION_CREDENTIALS</code> variable). Here is my script:</p>
  <pre><code>cross-env GOOGLE_APPLICATION_CREDENTIALS=./file.json firebase --project=dev deploy --only functions
  </code></pre>
  <p>This is working great, it's deploying my firebase functions successfully.</p>
  <p>However, when trying to use <a href="https://firebase.google.com/docs/functions/config-env" rel="nofollow noreferrer">Environment configuration</a>, I'm getting an error when I'm trying to get one of my config vars, using the following standard code:</p>
  <pre><code>const domain = functions.config().env.domain;
  </code></pre>
  <p>This is <strong>Only</strong> happening when this code line is executed <strong>outside</strong> a function, meaning in the global scope.</p>
  <p>This is the error I'm getting:</p>
  <blockquote>
  <p>Error: Error occurred while parsing your function triggers.
  TypeError: Cannot read property 'domain' of undefined</p>
  </blockquote>
  <p>IMPORTANT NOTE: When I'm logged in to firebase using <code>firebase login</code> command, I'm not getting this error, I'm getting that error only when I'm logged out!</p>
  <p>What am I doing wrong?</p>
  <p>Thanks!</p>