Parsing error: Unexpected token = In Firebase

1

I'm trying to deploy an index.js file in Firebase but I'm getting this error:

  

129: 41 error Parsing error: Unexpected token = >

This is my code :

const callSendAPI = async (messageData) => {
const url = "https://graph.facebook.com/v3.0/me/messages?access_token=" + fb_page_token;
try{
    const response =  await axios.post(url, messageData)
    if (response.status === 200) {
        var recipientId = response.data.recipient_id;
        var messageId = response.data.message_id;
        if (messageId) {
          console.log(
            "Successfully sent message with id %s to recipient %s",
            messageId,
            recipientId
          );
        } else {
          console.log(
            "Successfully called Send API for recipient %s",
            recipientId
          );
        }
      }
      return false;
    }
catch(error){
    console.log(error.response.headers);
    }
}

I'm working on Firebase .

const functions = require('firebase-functions');
const apiai = require('apiai');
const uuid = require("uuid");
const axios = require('axios');

And this is my eslintrc.json

 "parserOptions": {
// Required for certain syntax usages
"ecmaVersion": 6
},

Please be attentive to your help and thank you very much.

    
asked by Kristian Garcia V. 06.09.2018 в 19:40
source

0 answers