Firebase error: Function failed on loading user code (node.js)

Enter this command for getting log:

firebase functions:log

I had the exact same problem, trying to deploy the exact same code as you and I was just able to get it to deploy properly.

If yours is the same issue as mine, this is where the problem is:

var serviceAccount = require('../../service-acct/socialapp-e5130-firebase-adminsdk-uo6p6-5495e18b97.json');

It looks like when deploying to firebase you cant have code trying to reach outside your project folder, so the solution would be to have the key inside which isn't recommended or to set the environment variable GOOGLE_APPLICATION_CREDENTIALS to the file path of your service account key json file as explained in https://firebase.google.com/docs/admin/setup#windows and then just having

admin.initializeApp();