title: Google Firebase Cloud Functions generates error when using Firestore and implemented per the docs
body: <p>With the following code: </p>
  
  <pre><code>const functions = require('firebase-functions')
  const admin = require('firebase-admin')
  admin.initializeApp()
  
  exports.onTest = functions.https.onRequest(async (req, res) =&gt; {
    res.json({ msg: 'done' })
  })
  </code></pre>
  
  <p>which comes exactly from the <a href="https://github.com/firebase/functions-samples/blob/master/quickstarts/uppercase-firestore/functions/index.js" rel="noreferrer">example docs</a>, ... running <code>firebase emulators:start</code> from cli generates the following error:</p>
  
  <pre><code> ⚠  TypeError: instance.registerVersion is not a function
      at registerDatabase (/Users/&lt;path&gt;/functions/node_modules/@firebase/database/dist/index.node.cjs.js:15188:14)
      at Object.&lt;anonymous&gt; (/Users/&lt;path&gt;/functions/node_modules/@firebase/database/dist/index.node.cjs.js:15200:5)
      at Module._compile (module.js:653:30)
      at Object.Module._extensions..js (module.js:664:10)
      at Module.load (module.js:566:32)
      at tryModuleLoad (module.js:506:12)
      at Function.Module._load (module.js:498:3)
      at Module.require (module.js:597:17)
      at require (internal/module.js:11:18)
      at FirebaseNamespace.get [as database] (/Users/tremendus/Development/kulanu/playground/kulanu-cloud/functions/node_modules/firebase-admin/lib/firebase-namespace.js:282:38)
  ⚠  We were unable to load your functions code. (see above)
  </code></pre>
  
  <p>Several other examples on SO and other sites call <code>#initializeApp</code> with <code>initializeApp(functions.config().firebase)</code> ... but this also throws the same error.</p>
  
  <p>I'm using node 8 functions and node 8 locally and basic pacakage.json dependencies:</p>
  
  <pre><code>"dependencies": {
      "firebase-admin": "^8.6.0",
      "firebase-functions": "^3.3.0"
    }
  </code></pre>
  
  <p>UPDATE: although the command <code>firebase emulators:start</code> throws the above error, the functions work in shell: </p>
  
  <pre><code>MacPro:functions: firebase functions:shell
  ✔  functions: Emulator started at http://localhost:5000
  &gt;  function: apiOnSave
  i  functions: Loaded functions: apiOnSave
  firebase &gt; apiOnSave()
  Sent request to function.
  firebase &gt; &gt;  function: apiOnSave
  
  RESPONSE RECEIVED FROM FUNCTION: 200, {
    "msg": "done"
  }
  </code></pre>
  
  <p>Doesn't anyone have suggestions on how to resolve this?</p>