title: Firebase firestore: Cloud functions are not deploying properly
body: <p>I am trying to get the document data from the cloud firestore using cloud functions.But I am getting an error <code>Failed to configure trigger providers/cloud.firestore/eventTypes/document.write@firestore.googleapis.com (Split)</code></p>
  
  <pre><code>Error: Functions did not deploy properly.
  </code></pre>
  
  <p>I tried many options like updating my firebase tools, changing function name and deployed but still am getting the same error. 
   Here is the code</p>
  
  <pre><code>const functions = require('firebase-functions');
          const Firestore = require('@google-cloud/firestore');
          const firestore = new Firestore();
          const admin = require('firebase-admin');
          admin.initializeApp(functions.config().firebase);
          const db = admin.firestore();
          exports.splitting = functions.firestore
              .document('deyaPayUsers/{authid}/Split/{authid}/SentInvitations/{autoid}')
              .onWrite(event =&gt;{
              const ID = event.params.authid;
              const splitid = event.params.autoid;
              var document = event.data.data();
              //retrieve the data from the database and stored into document
              var ph1 = document.Invite1.PhoneNumber;
              console.log(document);
              console.log(ph1);
             });
  </code></pre>
  
  <p><em>My Database Path is</em> </p>
  
  <pre><code>/deyaPayUsers //collections
  {authid}    //Document
  /Split      //Collection
  {authid}    //Document
  /SentInvitations //Collection
  {autoid}         //document
     Invite1     //object
       PhoneNumber: 987654321, //number
       Amount:21               //number
  </code></pre>