firebasegoogle-cloud-functionsfacebook-webhooks

Firebase deploy issue. Running command: npm --prefix $RESOURCE_DIR run lint


Deploying 3 simple functions over firebase project to get started with and expecting their respective URLs after deploying but getting no url.

Here is the code:

const functions = require('firebase-functions');

// // Create and Deploy Your First Cloud Functions
// // https://firebase.google.com/docs/functions/write-firebase-functions
//
exports.helloWorldOne = functions.https.onRequest((request, response) => {
response.send("Hello 1 from Firebase!");
});

exports.helloWorldTwo = functions.https.onRequest((request, response) => {
response.send("Hello 2 from Firebase!");
});

exports.helloWorldThree = functions.https.onRequest((request, response) =>{
response.send("Hello 3 from Firebase!");
});

Output:

D:\IOT\DialogFlow\firebase functions>firebase deploy

=== Deploying to 'fir-functions-22d02'...

i deploying functions Running command: npm --prefix ./functions/ run lint

functions@ lint D:\IOT\DialogFlow\firebase functions\functions eslint .

Please note that it can take up to 30 seconds for your updated functions to propagate. Project Console: https://console.firebase.google.com/project/fir-functions-22d02/overview

I have tried the following:

- Deleting "npm --prefix \"$RESOURCE_DIR\" run lint".  

- Deleting complete "predeploy": [
      "npm --prefix \"$RESOURCE_DIR\" run lint"
    ]

Replaced the code with following:

-  {
  "functions": {
    "predeploy": [
      "npm --prefix ./functions/ run lint"
      "npm --prefix ./functions/ run build"
    ]
  }
}

- {
  "functions": {
    "predeploy": [
      "npm --prefix ./functions/ run lint"
    ]
  }
}

None of them worked.


Solution

  • I just deleted the comments from the code and deployed it again. It worked!

    Here is the output:

    functions@ lint D:\IOT\DialogFlow\firebase functions\functions eslint .

    The following functions are found in your project but do not exist in your local source code: helloWorldOne(us-central1)

    If you are renaming a function or changing its region, it is recommended that you create the new function first before deleting the old one to prevent event loss. For more info, visit https://firebase.google.com/docs/functions/manage-functions#modify

    ? Would you like to proceed with deletion? Selecting no will continue the rest o f the deployments. Yes i functions: deleting function helloWorldOne(us-central1)... + functions[helloWorldOne(us-central1)]: Successful delete operation. + functions[helloWorld(us-central1)]: Successful create operation. Function URL (helloWorld): https://us-central1-fir-functions-28de9.cloudfunctions.net/helloWorld + functions[helloWorldTwo(us-central1)]: Successful update operation.

    Please note that it can take up to 30 seconds for your updated functions to propagate. Project Console: https://console.firebase.google.com/project/fir-functions-28de9/overview