Home > Enterprise >  How to deploy a client/server website with Express, Vue.js, and firebase
How to deploy a client/server website with Express, Vue.js, and firebase

Time:10-26

I developed a website using Vue.js (for the front-end) and made a server to connect this website to an API (here it's Twitter). The server is made with Express.js. In localhost, everything is working. I have my server on localhost:8085 which is running, my website on localhost:8080. I can access data thanks to the Api through, for example, GET http://localhost:8085/TheNameOfTheApiFunction.

Because I want to deploy my website easily, I tried with Heroku and Firebase. I make "npm run build" with the front-end, put the result in the "public" directory of my server, the firebase.json is fine (I think).

  "hosting": {
    "public": "public",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ],
    "rewrites": [
      {
        "source": "**",
        "function":"app",
        "destination": "/index.html"
      }
    ]
  },
  "functions": {
    "predeploy": [
      "npm --prefix \"$RESOURCE_DIR\" run lint"
    ]
  }
}

At this point, when I launch the website, the front end is working but has no access to any of the API function. Seems logical because there is no localhost/8085 to ask functions to. GET http://localhost:8085/NameOfTheApiFunction net::ERR_CONNECTION_REFUSED

Because of this, I decided to explore the reasons and found that I should use what is propose in this tutorial : https://firebase.google.com/docs/hosting/functions#use_a_web_framework. So I copy-and-pasted what was in my app.js file to the index.js file create by firebase functions (in the functions directory). But it's not working.

What should I do to have a good deployment ? Should I change what is in the client in API.js for it to be adaptative ?


export default () => {
    return axios.create({
        baseURL: `http://localhost:8085/`
    })
}

EDIT To be clear.

  1. In the folder "myapp", I have the folder "client", there's my Vue.js front-end website in it and I launch it locally with npm run serve.

  2. In the same folder "myapp", I have the folder "server", which was necessary to connect to the Twitter Api, because it's not possible from the front-end. I launch it by doing "npm run start".

  3. My front-end acces to the "server" with Axios. The server anwser with get or post and is capable of asking information to the twitter API.

  4. Everything work just fine on localhost. I want to deploy the website and I followed this video : https://www.youtube.com/watch?v=GJwHevf2wYE The guy suggest to create a folder named "public" in the server part, in which you put all the files that come from the build (npm run build) of the "client". You add app.use(express.static("public")) in the server and when I launch, for example, localhost:8085 (i.e. the server) I can access the whole website in one command (and not two).

  5. Because this was working, I thougth I could launch the website by deploying the "server" folder. But it's not working, and I think this is because the "client" side is coded to ask for "localhost:8085/ApiFunctions". But I don't understand how I should deploy the server. That's why I tried to use firebase hosting, but I have the exact same problem : I don't understand exactly how this is running to know if the problem comes from my deployment method or the code(axios having baseURL: localhost:8085).

CodePudding user response:

I understand that:

  1. Your Vue.js app is served through the Firebase Hosting service.
  2. You pass your Express app to an HTTP Cloud Function, as explained in the doc you refer to and also here in the Cloud Functions doc.

If this understanding is correct, you can access your Express JS app (i.e. the Cloud Function) at the following URLs, as explained at the bottom of the doc (bullet point #2):

  • Your Firebase subdomains: <Firebase_project_ID>.web.app/<NameOfTheApiFunction> and <Firebase_project_ID>.firebaseapp.com/<NameOfTheApiFunction>

  • Or, any connected custom domains: <custom_domain>/<NameOfTheApiFunction>.


UPDATE FOLLOWING YOUR COMMENT:

It seems you want to access the CF while using the emulator. You should either use the emulator default port for Cloud Functions i.e. 5001, or configure it with another port, as desired. See the Emulators doc.

CodePudding user response:

I tried the last 4 hours to deploy de Cloud Function. It's not working ! I tried every solutions bring in this link https://github.com/firebase/firebase-functions/issues/795 but no results.

Here is the debug log :

*here I cuted a bit because it was too long*

[2021-10-26T13:48:47.603Z] >>> HTTP REQUEST POST https://cloudfunctions.googleapis.com/v1/projects/discovidapp/locations/us-central1/functions:generateUploadUrl

{"name":"operations/ZGlzY292aWRhcHAvdXMtY2VudHJhbDEvYXBwL21Lcml2U0V1Y2kw","metadata":{"@type":"type.googleapis.com/google.cloud.functions.v1.OperationMetadataV1","target":"projects/discovidapp/locations/us-central1/functions/app","type":"UPDATE_FUNCTION","request":{"@type":"type.googleapis.com/google.cloud.functions.v1.CloudFunction","name":"projects/discovidapp/locations/us-central1/functions/app","httpsTrigger":{},"status":"OFFLINE","entryPoint":"app","timeout":"60s","availableMemoryMb":256,"serviceAccountEmail":"[email protected]","updateTime":"2021-10-26T10:20:45.593Z","versionId":"8","labels":{"deployment-tool":"cli-firebase"},"sourceUploadUrl":"https://storage.googleapis.com/gcf-upload-us-central1-8e7df05c-c33f-4e4f-96e7-5aef3b52a278/d00decc0-e530-4657-8ff2-7bd16c3ac558.zip?GoogleAccessId=service-791445583548@gcf-admin-robot.iam.gserviceaccount.com&Expires=1635257928&Signature=MsCBK3tOV+cu6Zl0aGrK5YICogoZFgGK+h3wYRr8DB6FoLsbi+OcnXr+ztnnBB3vJbMfq/Rpy+KKMumCqCHEfmvkcBoCgFBuRAcwrjbpc3wuUkclw8TC8s9FwUnY8X5z7jqEEUNBF1S/Zg/GRONwCjhRxbnCSmS8JKTzFsFjCy08EIhKeRT6whHDGpZNEgtgZs7bDrjL49b8rBkr8ReEKrE+ymxMgwB2+tZpNg3MC9wjILfZiwlRLQwayDnFDDtCeGQ2pt2YLj/F8ipcyYw97EqiyyxvVdy7ZX37af4CMwxAwZrxsEG3wuY+cOoDaR/OWbbDJgNh9VrLCoGBottK1A==","environmentVariables":{"FIREBASE_CONFIG":"{\"projectId\":\"discovidapp\",\"databaseURL\":\"https://discovidapp-default-rtdb.europe-west1.firebasedatabase.app\",\"storageBucket\":\"discovidapp.appspot.com\",\"locationId\":\"europe-west\"}","GCLOUD_PROJECT":"discovidapp"},"runtime":"nodejs14","ingressSettings":"ALLOW_ALL","buildId":"ba5f7a0b-f1db-4315-97e8-8dbd9b35f141","buildName":"projects/791445583548/locations/us-central1/builds/ba5f7a0b-f1db-4315-97e8-8dbd9b35f141"},"versionId":"9","updateTime":"2021-10-26T13:48:49Z","buildName":"projects/791445583548/locations/us-central1/builds/ba5f7a0b-f1db-4315-97e8-8dbd9b35f141"}}  
[2021-10-26T13:48:50.849Z] [update-us-central1-app] Retrying task index 0
[2021-10-26T13:48:50.852Z] >>> [apiv2][query] GET https://cloudfunctions.googleapis.com/v1/operations/ZGlzY292aWRhcHAvdXMtY2VudHJhbDEvYXBwL21Lcml2U0V1Y2kw [none]
[2021-10-26T13:48:51.196Z] <<< [apiv2][status] GET https://cloudfunctions.googleapis.com/v1/operations/ZGlzY292aWRhcHAvdXMtY2VudHJhbDEvYXBwL21Lcml2U0V1Y2kw 200
[2021-10-26T13:48:51.198Z] <<< [apiv2][body] GET https://cloudfunctions.googleapis.com/v1/operations/ZGlzY292aWRhcHAvdXMtY2VudHJhbDEvYXBwL21Lcml2U0V1Y2kw {"name":"operations/ZGlzY292aWRhcHAvdXMtY2VudHJhbDEvYXBwL21Lcml2U0V1Y2kw","metadata":{"@type":"type.googleapis.com/google.cloud.functions.v1.OperationMetadataV1","target":"projects/discovidapp/locations/us-central1/functions/app","type":"UPDATE_FUNCTION","request":{"@type":"type.googleapis.com/google.cloud.functions.v1.CloudFunction","name":"projects/discovidapp/locations/us-central1/functions/app","httpsTrigger":{},"status":"OFFLINE","entryPoint":"app","timeout":"60s","availableMemoryMb":256,"serviceAccountEmail":"[email protected]","updateTime":"2021-10-26T10:20:45.593Z","versionId":"8","labels":{"deployment-tool":"cli-firebase"},"sourceUploadUrl":"https://storage.googleapis.com/gcf-upload-us-central1-8e7df05c-c33f-4e4f-96e7-5aef3b52a278/d00decc0-e530-4657-8ff2-7bd16c3ac558.zip?GoogleAccessId=service-791445583548@gcf-admin-robot.iam.gserviceaccount.com&Expires=1635257928&Signature=MsCBK3tOV+cu6Zl0aGrK5YICogoZFgGK+h3wYRr8DB6FoLsbi+OcnXr+ztnnBB3vJbMfq/Rpy+KKMumCqCHEfmvkcBoCgFBuRAcwrjbpc3wuUkclw8TC8s9FwUnY8X5z7jqEEUNBF1S/Zg/GRONwCjhRxbnCSmS8JKTzFsFjCy08EIhKeRT6whHDGpZNEgtgZs7bDrjL49b8rBkr8ReEKrE+ymxMgwB2+tZpNg3MC9wjILfZiwlRLQwayDnFDDtCeGQ2pt2YLj/F8ipcyYw97EqiyyxvVdy7ZX37af4CMwxAwZrxsEG3wuY+cOoDaR/OWbbDJgNh9VrLCoGBottK1A==","environmentVariables":{"FIREBASE_CONFIG":"{\"projectId\":\"discovidapp\",\"databaseURL\":\"https://discovidapp-default-rtdb.europe-west1.firebasedatabase.app\",\"storageBucket\":\"discovidapp.appspot.com\",\"locationId\":\"europe-west\"}","GCLOUD_PROJECT":"discovidapp"},"runtime":"nodejs14","ingressSettings":"ALLOW_ALL","buildId":"ba5f7a0b-f1db-4315-97e8-8dbd9b35f141","buildName":"projects/791445583548/locations/us-central1/builds/ba5f7a0b-f1db-4315-97e8-8dbd9b35f141"},"versionId":"9","updateTime":"2021-10-26T13:48:49Z","buildId":"13be5780-9683-4ce4-9098-771e35715ca6","buildName":"projects/791445583548/locations/us-central1/builds/13be5780-9683-4ce4-9098-771e35715ca6"}}
[2021-10-26T13:48:52.218Z] [update-us-central1-app] Retrying task index 0
[2021-10-26T13:48:52.220Z] >>> [apiv2][query] GET https://cloudfunctions.googleapis.com/v1/operations/ZGlzY292aWRhcHAvdXMtY2VudHJhbDEvYXBwL21Lcml2U0V1Y2kw [none]
[2021-10-26T13:48:52.581Z] <<< [apiv2][status] GET https://cloudfunctions.googleapis.com/v1/operations/ZGlzY292aWRhcHAvdXMtY2VudHJhbDEvYXBwL21Lcml2U0V1Y2kw 200
[2021-10-26T13:48:52.583Z] <<< [apiv2][body] GET https://cloudfunctions.googleapis.com/v1/operations/ZGlzY292aWRhcHAvdXMtY2VudHJhbDEvYXBwL21Lcml2U0V1Y2kw {"name":"operations/ZGlzY292aWRhcHAvdXMtY2VudHJhbDEvYXBwL21Lcml2U0V1Y2kw","metadata":{"@type":"type.googleapis.com/google.cloud.functions.v1.OperationMetadataV1","target":"projects/discovidapp/locations/us-central1/functions/app","type":"UPDATE_FUNCTION","request":{"@type":"type.googleapis.com/google.cloud.functions.v1.CloudFunction","name":"projects/discovidapp/locations/us-central1/functions/app","httpsTrigger":{},"status":"OFFLINE","entryPoint":"app","timeout":"60s","availableMemoryMb":256,"serviceAccountEmail":"[email protected]","updateTime":"2021-10-26T10:20:45.593Z","versionId":"8","labels":{"deployment-tool":"cli-firebase"},"sourceUploadUrl":"https://storage.googleapis.com/gcf-upload-us-central1-8e7df05c-c33f-4e4f-96e7-5aef3b52a278/d00decc0-e530-4657-8ff2-7bd16c3ac558.zip?GoogleAccessId=service-791445583548@gcf-admin-robot.iam.gserviceaccount.com&Expires=1635257928&Signature=MsCBK3tOV+cu6Zl0aGrK5YICogoZFgGK+h3wYRr8DB6FoLsbi+OcnXr+ztnnBB3vJbMfq/Rpy+KKMumCqCHEfmvkcBoCgFBuRAcwrjbpc3wuUkclw8TC8s9FwUnY8X5z7jqEEUNBF1S/Zg/GRONwCjhRxbnCSmS8JKTzFsFjCy08EIhKeRT6whHDGpZNEgtgZs7bDrjL49b8rBkr8ReEKrE+ymxMgwB2+tZpNg3MC9wjILfZiwlRLQwayDnFDDtCeGQ2pt2YLj/F8ipcyYw97EqiyyxvVdy7ZX37af4CMwxAwZrxsEG3wuY+cOoDaR/OWbbDJgNh9VrLCoGBottK1A==","environmentVariables":{"FIREBASE_CONFIG":"{\"projectId\":\"discovidapp\",\"databaseURL\":\"https://discovidapp-default-rtdb.europe-west1.firebasedatabase.app\",\"storageBucket\":\"discovidapp.appspot.com\",\"locationId\":\"europe-west\"}","GCLOUD_PROJECT":"discovidapp"},"runtime":"nodejs14","ingressSettings":"ALLOW_ALL","buildId":"ba5f7a0b-f1db-4315-97e8-8dbd9b35f141","buildName":"projects/791445583548/locations/us-central1/builds/ba5f7a0b-f1db-4315-97e8-8dbd9b35f141"},"versionId":"9","updateTime":"2021-10-26T13:48:49Z","buildId":"13be5780-9683-4ce4-9098-771e35715ca6","buildName":"projects/791445583548/locations/us-central1/builds/13be5780-9683-4ce4-9098-771e35715ca6"}}
[2021-10-26T13:48:54.593Z] [update-us-central1-app] Retrying task index 0
[2021-10-26T13:48:54.596Z] >>> [apiv2][query] GET https://cloudfunctions.googleapis.com/v1/operations/ZGlzY292aWRhcHAvdXMtY2VudHJhbDEvYXBwL21Lcml2U0V1Y2kw [none]
[2021-10-26T13:48:55.022Z] <<< [apiv2][status] GET https://cloudfunctions.googleapis.com/v1/operations/ZGlzY292aWRhcHAvdXMtY2VudHJhbDEvYXBwL21Lcml2U0V1Y2kw 200
[2021-10-26T13:48:55.024Z] <<< [apiv2][body] GET https://cloudfunctions.googleapis.com/v1/operations/ZGlzY292aWRhcHAvdXMtY2VudHJhbDEvYXBwL21Lcml2U0V1Y2kw {"name":"operations/ZGlzY292aWRhcHAvdXMtY2VudHJhbDEvYXBwL21Lcml2U0V1Y2kw","metadata":{"@type":"type.googleapis.com/google.cloud.functions.v1.OperationMetadataV1","target":"projects/discovidapp/locations/us-central1/functions/app","type":"UPDATE_FUNCTION","request":{"@type":"type.googleapis.com/google.cloud.functions.v1.CloudFunction","name":"projects/discovidapp/locations/us-central1/functions/app","httpsTrigger":{},"status":"OFFLINE","entryPoint":"app","timeout":"60s","availableMemoryMb":256,"serviceAccountEmail":"[email protected]","updateTime":"2021-10-26T10:20:45.593Z","versionId":"8","labels":{"deployment-tool":"cli-firebase"},"sourceUploadUrl":"https://storage.googleapis.com/gcf-upload-us-central1-8e7df05c-c33f-4e4f-96e7-5aef3b52a278/d00decc0-e530-4657-8ff2-7bd16c3ac558.zip?GoogleAccessId=service-791445583548@gcf-admin-robot.iam.gserviceaccount.com&Expires=1635257928&Signature=MsCBK3tOV+cu6Zl0aGrK5YICogoZFgGK+h3wYRr8DB6FoLsbi+OcnXr+ztnnBB3vJbMfq/Rpy+KKMumCqCHEfmvkcBoCgFBuRAcwrjbpc3wuUkclw8TC8s9FwUnY8X5z7jqEEUNBF1S/Zg/GRONwCjhRxbnCSmS8JKTzFsFjCy08EIhKeRT6whHDGpZNEgtgZs7bDrjL49b8rBkr8ReEKrE+ymxMgwB2+tZpNg3MC9wjILfZiwlRLQwayDnFDDtCeGQ2pt2YLj/F8ipcyYw97EqiyyxvVdy7ZX37af4CMwxAwZrxsEG3wuY+cOoDaR/OWbbDJgNh9VrLCoGBottK1A==","environmentVariables":{"FIREBASE_CONFIG":"{\"projectId\":\"discovidapp\",\"databaseURL\":\"https://discovidapp-default-rtdb.europe-west1.firebasedatabase.app\",\"storageBucket\":\"discovidapp.appspot.com\",\"locationId\":\"europe-west\"}","GCLOUD_PROJECT":"discovidapp"},"runtime":"nodejs14","ingressSettings":"ALLOW_ALL","buildId":"ba5f7a0b-f1db-4315-97e8-8dbd9b35f141","buildName":"projects/791445583548/locations/us-central1/builds/ba5f7a0b-f1db-4315-97e8-8dbd9b35f141"},"versionId":"9","updateTime":"2021-10-26T13:48:49Z","buildId":"13be5780-9683-4ce4-9098-771e35715ca6","buildName":"projects/791445583548/locations/us-central1/builds/13be5780-9683-4ce4-9098-771e35715ca6"}}
[2021-10-26T13:48:59.041Z] [update-us-central1-app] Retrying task index 0
[2021-10-26T13:48:59.044Z] >>> [apiv2][query] GET https://cloudfunctions.googleapis.com/v1/operations/ZGlzY292aWRhcHAvdXMtY2VudHJhbDEvYXBwL21Lcml2U0V1Y2kw [none]
[2021-10-26T13:48:59.450Z] <<< [apiv2][status] GET https://cloudfunctions.googleapis.com/v1/operations/ZGlzY292aWRhcHAvdXMtY2VudHJhbDEvYXBwL21Lcml2U0V1Y2kw 200
[2021-10-26T13:48:59.451Z] <<< [apiv2][body] GET https://cloudfunctions.googleapis.com/v1/operations/ZGlzY292aWRhcHAvdXMtY2VudHJhbDEvYXBwL21Lcml2U0V1Y2kw {"name":"operations/ZGlzY292aWRhcHAvdXMtY2VudHJhbDEvYXBwL21Lcml2U0V1Y2kw","metadata":{"@type":"type.googleapis.com/google.cloud.functions.v1.OperationMetadataV1","target":"projects/discovidapp/locations/us-central1/functions/app","type":"UPDATE_FUNCTION","request":{"@type":"type.googleapis.com/google.cloud.functions.v1.CloudFunction","name":"projects/discovidapp/locations/us-central1/functions/app","httpsTrigger":{},"status":"OFFLINE","entryPoint":"app","timeout":"60s","availableMemoryMb":256,"serviceAccountEmail":"[email protected]","updateTime":"2021-10-26T10:20:45.593Z","versionId":"8","labels":{"deployment-tool":"cli-firebase"},"sourceUploadUrl":"https://storage.googleapis.com/gcf-upload-us-central1-8e7df05c-c33f-4e4f-96e7-5aef3b52a278/d00decc0-e530-4657-8ff2-7bd16c3ac558.zip?GoogleAccessId=service-791445583548@gcf-admin-robot.iam.gserviceaccount.com&Expires=1635257928&Signature=MsCBK3tOV+cu6Zl0aGrK5YICogoZFgGK+h3wYRr8DB6FoLsbi+OcnXr+ztnnBB3vJbMfq/Rpy+KKMumCqCHEfmvkcBoCgFBuRAcwrjbpc3wuUkclw8TC8s9FwUnY8X5z7jqEEUNBF1S/Zg/GRONwCjhRxbnCSmS8JKTzFsFjCy08EIhKeRT6whHDGpZNEgtgZs7bDrjL49b8rBkr8ReEKrE+ymxMgwB2+tZpNg3MC9wjILfZiwlRLQwayDnFDDtCeGQ2pt2YLj/F8ipcyYw97EqiyyxvVdy7ZX37af4CMwxAwZrxsEG3wuY+cOoDaR/OWbbDJgNh9VrLCoGBottK1A==","environmentVariables":{"FIREBASE_CONFIG":"{\"projectId\":\"discovidapp\",\"databaseURL\":\"https://discovidapp-default-rtdb.europe-west1.firebasedatabase.app\",\"storageBucket\":\"discovidapp.appspot.com\",\"locationId\":\"europe-west\"}","GCLOUD_PROJECT":"discovidapp"},"runtime":"nodejs14","ingressSettings":"ALLOW_ALL","buildId":"ba5f7a0b-f1db-4315-97e8-8dbd9b35f141","buildName":"projects/791445583548/locations/us-central1/builds/ba5f7a0b-f1db-4315-97e8-8dbd9b35f141"},"versionId":"9","updateTime":"2021-10-26T13:48:49Z","buildId":"13be5780-9683-4ce4-9098-771e35715ca6","buildName":"projects/791445583548/locations/us-central1/builds/13be5780-9683-4ce4-9098-771e35715ca6"}}
[2021-10-26T13:49:07.459Z] [update-us-central1-app] Retrying task index 0
[2021-10-26T13:49:07.462Z] >>> [apiv2][query] GET https://cloudfunctions.googleapis.com/v1/operations/ZGlzY292aWRhcHAvdXMtY2VudHJhbDEvYXBwL21Lcml2U0V1Y2kw [none]
[2021-10-26T13:49:07.816Z] <<< [apiv2][status] GET https://cloudfunctions.googleapis.com/v1/operations/ZGlzY292aWRhcHAvdXMtY2VudHJhbDEvYXBwL21Lcml2U0V1Y2kw 200
[2021-10-26T13:49:07.817Z] <<< [apiv2][body] GET https://cloudfunctions.googleapis.com/v1/operations/ZGlzY292aWRhcHAvdXMtY2VudHJhbDEvYXBwL21Lcml2U0V1Y2kw {"name":"operations/ZGlzY292aWRhcHAvdXMtY2VudHJhbDEvYXBwL21Lcml2U0V1Y2kw","metadata":{"@type":"type.googleapis.com/google.cloud.functions.v1.OperationMetadataV1","target":"projects/discovidapp/locations/us-central1/functions/app","type":"UPDATE_FUNCTION","request":{"@type":"type.googleapis.com/google.cloud.functions.v1.CloudFunction","name":"projects/discovidapp/locations/us-central1/functions/app","httpsTrigger":{},"status":"OFFLINE","entryPoint":"app","timeout":"60s","availableMemoryMb":256,"serviceAccountEmail":"[email protected]","updateTime":"2021-10-26T10:20:45.593Z","versionId":"8","labels":{"deployment-tool":"cli-firebase"},"sourceUploadUrl":"https://storage.googleapis.com/gcf-upload-us-central1-8e7df05c-c33f-4e4f-96e7-5aef3b52a278/d00decc0-e530-4657-8ff2-7bd16c3ac558.zip?GoogleAccessId=service-791445583548@gcf-admin-robot.iam.gserviceaccount.com&Expires=1635257928&Signature=MsCBK3tOV+cu6Zl0aGrK5YICogoZFgGK+h3wYRr8DB6FoLsbi+OcnXr+ztnnBB3vJbMfq/Rpy+KKMumCqCHEfmvkcBoCgFBuRAcwrjbpc3wuUkclw8TC8s9FwUnY8X5z7jqEEUNBF1S/Zg/GRONwCjhRxbnCSmS8JKTzFsFjCy08EIhKeRT6whHDGpZNEgtgZs7bDrjL49b8rBkr8ReEKrE+ymxMgwB2+tZpNg3MC9wjILfZiwlRLQwayDnFDDtCeGQ2pt2YLj/F8ipcyYw97EqiyyxvVdy7ZX37af4CMwxAwZrxsEG3wuY+cOoDaR/OWbbDJgNh9VrLCoGBottK1A==","environmentVariables":{"FIREBASE_CONFIG":"{\"projectId\":\"discovidapp\",\"databaseURL\":\"https://discovidapp-default-rtdb.europe-west1.firebasedatabase.app\",\"storageBucket\":\"discovidapp.appspot.com\",\"locationId\":\"europe-west\"}","GCLOUD_PROJECT":"discovidapp"},"runtime":"nodejs14","ingressSettings":"ALLOW_ALL","buildId":"ba5f7a0b-f1db-4315-97e8-8dbd9b35f141","buildName":"projects/791445583548/locations/us-central1/builds/ba5f7a0b-f1db-4315-97e8-8dbd9b35f141"},"versionId":"9","updateTime":"2021-10-26T13:48:49Z","buildId":"13be5780-9683-4ce4-9098-771e35715ca6","buildName":"projects/791445583548/locations/us-central1/builds/13be5780-9683-4ce4-9098-771e35715ca6"}}
[2021-10-26T13:49:23.827Z] [update-us-central1-app] Retrying task index 0
[2021-10-26T13:49:23.829Z] >>> [apiv2][query] GET https://cloudfunctions.googleapis.com/v1/operations/ZGlzY292aWRhcHAvdXMtY2VudHJhbDEvYXBwL21Lcml2U0V1Y2kw [none]
[2021-10-26T13:49:24.169Z] <<< [apiv2][status] GET https://cloudfunctions.googleapis.com/v1/operations/ZGlzY292aWRhcHAvdXMtY2VudHJhbDEvYXBwL21Lcml2U0V1Y2kw 200
[2021-10-26T13:49:24.171Z] <<< [apiv2][body] GET https://cloudfunctions.googleapis.com/v1/operations/ZGlzY292aWRhcHAvdXMtY2VudHJhbDEvYXBwL21Lcml2U0V1Y2kw {"name":"operations/ZGlzY292aWRhcHAvdXMtY2VudHJhbDEvYXBwL21Lcml2U0V1Y2kw","metadata":{"@type":"type.googleapis.com/google.cloud.functions.v1.OperationMetadataV1","target":"projects/discovidapp/locations/us-central1/functions/app","type":"UPDATE_FUNCTION","request":{"@type":"type.googleapis.com/google.cloud.functions.v1.CloudFunction","name":"projects/discovidapp/locations/us-central1/functions/app","httpsTrigger":{},"status":"OFFLINE","entryPoint":"app","timeout":"60s","availableMemoryMb":256,"serviceAccountEmail":"[email protected]","updateTime":"2021-10-26T10:20:45.593Z","versionId":"8","labels":{"deployment-tool":"cli-firebase"},"sourceUploadUrl":"https://storage.googleapis.com/gcf-upload-us-central1-8e7df05c-c33f-4e4f-96e7-5aef3b52a278/d00decc0-e530-4657-8ff2-7bd16c3ac558.zip?GoogleAccessId=service-791445583548@gcf-admin-robot.iam.gserviceaccount.com&Expires=1635257928&Signature=MsCBK3tOV+cu6Zl0aGrK5YICogoZFgGK+h3wYRr8DB6FoLsbi+OcnXr+ztnnBB3vJbMfq/Rpy+KKMumCqCHEfmvkcBoCgFBuRAcwrjbpc3wuUkclw8TC8s9FwUnY8X5z7jqEEUNBF1S/Zg/GRONwCjhRxbnCSmS8JKTzFsFjCy08EIhKeRT6whHDGpZNEgtgZs7bDrjL49b8rBkr8ReEKrE+ymxMgwB2+tZpNg3MC9wjILfZiwlRLQwayDnFDDtCeGQ2pt2YLj/F8ipcyYw97EqiyyxvVdy7ZX37af4CMwxAwZrxsEG3wuY+cOoDaR/OWbbDJgNh9VrLCoGBottK1A==","environmentVariables":{"FIREBASE_CONFIG":"{\"projectId\":\"discovidapp\",\"databaseURL\":\"https://discovidapp-default-rtdb.europe-west1.firebasedatabase.app\",\"storageBucket\":\"discovidapp.appspot.com\",\"locationId\":\"europe-west\"}","GCLOUD_PROJECT":"discovidapp"},"runtime":"nodejs14","ingressSettings":"ALLOW_ALL","buildId":"ba5f7a0b-f1db-4315-97e8-8dbd9b35f141","buildName":"projects/791445583548/locations/us-central1/builds/ba5f7a0b-f1db-4315-97e8-8dbd9b35f141"},"versionId":"9","updateTime":"2021-10-26T13:48:49Z","buildId":"13be5780-9683-4ce4-9098-771e35715ca6","buildName":"projects/791445583548/locations/us-central1/builds/13be5780-9683-4ce4-9098-771e35715ca6"}}
[2021-10-26T13:49:56.182Z] [update-us-central1-app] Retrying task index 0
[2021-10-26T13:49:56.185Z] >>> [apiv2][query] GET https://cloudfunctions.googleapis.com/v1/operations/ZGlzY292aWRhcHAvdXMtY2VudHJhbDEvYXBwL21Lcml2U0V1Y2kw [none]
[2021-10-26T13:49:56.605Z] <<< [apiv2][status] GET https://cloudfunctions.googleapis.com/v1/operations/ZGlzY292aWRhcHAvdXMtY2VudHJhbDEvYXBwL21Lcml2U0V1Y2kw 200
[2021-10-26T13:49:56.606Z] <<< [apiv2][body] GET https://cloudfunctions.googleapis.com/v1/operations/ZGlzY292aWRhcHAvdXMtY2VudHJhbDEvYXBwL21Lcml2U0V1Y2kw {"name":"operations/ZGlzY292aWRhcHAvdXMtY2VudHJhbDEvYXBwL21Lcml2U0V1Y2kw","metadata":{"@type":"type.googleapis.com/google.cloud.functions.v1.OperationMetadataV1","target":"projects/discovidapp/locations/us-central1/functions/app","type":"UPDATE_FUNCTION","request":{"@type":"type.googleapis.com/google.cloud.functions.v1.CloudFunction","name":"projects/discovidapp/locations/us-central1/functions/app","httpsTrigger":{},"status":"OFFLINE","entryPoint":"app","timeout":"60s","availableMemoryMb":256,"serviceAccountEmail":"[email protected]","updateTime":"2021-10-26T10:20:45.593Z","versionId":"8","labels":{"deployment-tool":"cli-firebase"},"sourceUploadUrl":"https://storage.googleapis.com/gcf-upload-us-central1-8e7df05c-c33f-4e4f-96e7-5aef3b52a278/d00decc0-e530-4657-8ff2-7bd16c3ac558.zip?GoogleAccessId=service-791445583548@gcf-admin-robot.iam.gserviceaccount.com&Expires=1635257928&Signature=MsCBK3tOV+cu6Zl0aGrK5YICogoZFgGK+h3wYRr8DB6FoLsbi+OcnXr+ztnnBB3vJbMfq/Rpy+KKMumCqCHEfmvkcBoCgFBuRAcwrjbpc3wuUkclw8TC8s9FwUnY8X5z7jqEEUNBF1S/Zg/GRONwCjhRxbnCSmS8JKTzFsFjCy08EIhKeRT6whHDGpZNEgtgZs7bDrjL49b8rBkr8ReEKrE+ymxMgwB2+tZpNg3MC9wjILfZiwlRLQwayDnFDDtCeGQ2pt2YLj/F8ipcyYw97EqiyyxvVdy7ZX37af4CMwxAwZrxsEG3wuY+cOoDaR/OWbbDJgNh9VrLCoGBottK1A==","environmentVariables":{"FIREBASE_CONFIG":"{\"projectId\":\"discovidapp\",\"databaseURL\":\"https://discovidapp-default-rtdb.europe-west1.firebasedatabase.app\",\"storageBucket\":\"discovidapp.appspot.com\",\"locationId\":\"europe-west\"}","GCLOUD_PROJECT":"discovidapp"},"runtime":"nodejs14","ingressSettings":"ALLOW_ALL","buildId":"ba5f7a0b-f1db-4315-97e8-8dbd9b35f141","buildName":"projects/791445583548/locations/us-central1/builds/ba5f7a0b-f1db-4315-97e8-8dbd9b35f141"},"versionId":"9","updateTime":"2021-10-26T13:48:49Z","buildId":"13be5780-9683-4ce4-9098-771e35715ca6","buildName":"projects/791445583548/locations/us-central1/builds/13be5780-9683-4ce4-9098-771e35715ca6"}}
[2021-10-26T13:50:56.623Z] [update-us-central1-app] Retrying task index 0
[2021-10-26T13:50:56.625Z] >>> [apiv2][query] GET https://cloudfunctions.googleapis.com/v1/operations/ZGlzY292aWRhcHAvdXMtY2VudHJhbDEvYXBwL21Lcml2U0V1Y2kw [none]
[2021-10-26T13:50:57.069Z] <<< [apiv2][status] GET https://cloudfunctions.googleapis.com/v1/operations/ZGlzY292aWRhcHAvdXMtY2VudHJhbDEvYXBwL21Lcml2U0V1Y2kw 200
[2021-10-26T13:50:57.071Z] <<< [apiv2][body] GET https://cloudfunctions.googleapis.com/v1/operations/ZGlzY292aWRhcHAvdXMtY2VudHJhbDEvYXBwL21Lcml2U0V1Y2kw {"name":"operations/ZGlzY292aWRhcHAvdXMtY2VudHJhbDEvYXBwL21Lcml2U0V1Y2kw","metadata":{"@type":"type.googleapis.com/google.cloud.functions.v1.OperationMetadataV1","target":"projects/discovidapp/locations/us-central1/functions/app","type":"UPDATE_FUNCTION","request":{"@type":"type.googleapis.com/google.cloud.functions.v1.CloudFunction","name":"projects/discovidapp/locations/us-central1/functions/app","httpsTrigger":{},"status":"OFFLINE","entryPoint":"app","timeout":"60s","availableMemoryMb":256,"serviceAccountEmail":"[email protected]","updateTime":"2021-10-26T10:20:45.593Z","versionId":"8","labels":{"deployment-tool":"cli-firebase"},"sourceUploadUrl":"https://storage.googleapis.com/gcf-upload-us-central1-8e7df05c-c33f-4e4f-96e7-5aef3b52a278/d00decc0-e530-4657-8ff2-7bd16c3ac558.zip?GoogleAccessId=service-791445583548@gcf-admin-robot.iam.gserviceaccount.com&Expires=1635257928&Signature=MsCBK3tOV+cu6Zl0aGrK5YICogoZFgGK+h3wYRr8DB6FoLsbi+OcnXr+ztnnBB3vJbMfq/Rpy+KKMumCqCHEfmvkcBoCgFBuRAcwrjbpc3wuUkclw8TC8s9FwUnY8X5z7jqEEUNBF1S/Zg/GRONwCjhRxbnCSmS8JKTzFsFjCy08EIhKeRT6whHDGpZNEgtgZs7bDrjL49b8rBkr8ReEKrE+ymxMgwB2+tZpNg3MC9wjILfZiwlRLQwayDnFDDtCeGQ2pt2YLj/F8ipcyYw97EqiyyxvVdy7ZX37af4CMwxAwZrxsEG3wuY+cOoDaR/OWbbDJgNh9VrLCoGBottK1A==","environmentVariables":{"FIREBASE_CONFIG":"{\"projectId\":\"discovidapp\",\"databaseURL\":\"https://discovidapp-default-rtdb.europe-west1.firebasedatabase.app\",\"storageBucket\":\"discovidapp.appspot.com\",\"locationId\":\"europe-west\"}","GCLOUD_PROJECT":"discovidapp"},"runtime":"nodejs14","ingressSettings":"ALLOW_ALL","buildId":"ba5f7a0b-f1db-4315-97e8-8dbd9b35f141","buildName":"projects/791445583548/locations/us-central1/builds/ba5f7a0b-f1db-4315-97e8-8dbd9b35f141"},"versionId":"9","updateTime":"2021-10-26T13:50:54Z","buildId":"13be5780-9683-4ce4-9098-771e35715ca6","sourceToken":"bf71b483-47f5-405f-960c-1f402779448d","buildName":"projects/791445583548/locations/us-central1/builds/13be5780-9683-4ce4-9098-771e35715ca6"},"done":true,"error":{"code":3,"message":"Function failed on 
loading user code. This is likely due to a bug in the user code. Error message: Error: please examine your function logs to see the error cause: https://cloud.google.com/functions/docs/monitoring/logging#viewing_logs. Additional troubleshooting documentation can be found at https://cloud.google.com/functions/docs/troubleshooting#logging. Please visit https://cloud.google.com/functions/docs/troubleshooting for in-depth troubleshooting documentation."}}
[2021-10-26T13:50:57.077Z] Got source token bf71b483-47f5-405f-960c-1f402779448d for region us-central1
[2021-10-26T13:50:57.084Z] Total Function Deployment time: 128001
[2021-10-26T13:50:57.085Z] 1 Functions Deployed
[2021-10-26T13:50:57.085Z] 1 Functions Errored
[2021-10-26T13:50:57.086Z] 0 Function Deployments Aborted
[2021-10-26T13:50:57.087Z] Average Function Deployment time: 127998

Functions deploy had errors with the following functions:
        app(us-central1)

Because there were errors creating or updating functions, the following functions were not deleted
To delete these, use firebase functions:delete
[2021-10-26T13:50:57.095Z] Missing URI for HTTPS function in printTriggerUrls. This shouldn't happen
i  functions: cleaning up build files...
[2021-10-26T13:50:57.099Z] >>> [apiv2][query] GET https://us.gcr.io/v2/discovidapp/gcf/us-central1/tags/list [none]
[2021-10-26T13:50:57.944Z] <<< [apiv2][status] GET https://us.gcr.io/v2/discovidapp/gcf/us-central1/tags/list 200
[2021-10-26T13:50:57.946Z] <<< [apiv2][body] GET https://us.gcr.io/v2/discovidapp/gcf/us-central1/tags/list {"child":["135a2c4c-3a89-4a7b-9581-1f3e359cc771"],"manifest":{},"name":"discovidapp/gcf/us-central1","tags":[]}
[2021-10-26T13:50:57.948Z] >>> [apiv2][query] GET https://us.gcr.io/v2/discovidapp/gcf/us-central1/135a2c4c-3a89-4a7b-9581-1f3e359cc771/tags/list [none]        
[2021-10-26T13:50:58.583Z] <<< [apiv2][status] GET https://us.gcr.io/v2/discovidapp/gcf/us-central1/135a2c4c-3a89-4a7b-9581-1f3e359cc771/tags/list 200
[2021-10-26T13:50:58.584Z] <<< [apiv2][body] GET https://us.gcr.io/v2/discovidapp/gcf/us-central1/135a2c4c-3a89-4a7b-9581-1f3e359cc771/tags/list {"child":["cache"],"manifest":{"sha256:e6ae0ee7556ad1612c20b339c675eb0abd06caa1511ed4f2f5487fb2f48c3558":{"imageSizeBytes":"423240166","layerId":"","mediaType":"application/vnd.docker.distribution.manifest.v2 json","tag":["app_version-9","latest"],"timeCreatedMs":"315532801000","timeUploadedMs":"1635256221475"}},"name":"discovidapp/gcf/us-central1/135a2c4c-3a89-4a7b-9581-1f3e359cc771","tags":["app_version-9","latest"]}
[2021-10-26T13:50:58.592Z] >>> [apiv2][query] GET https://us.gcr.io/v2/discovidapp/gcf/us-central1/135a2c4c-3a89-4a7b-9581-1f3e359cc771/cache/tags/list [none]  
[2021-10-26T13:50:58.599Z] >>> [apiv2][query] DELETE https://us.gcr.io/v2/discovidapp/gcf/us-central1/135a2c4c-3a89-4a7b-9581-1f3e359cc771/manifests/app_version-9 [none]
[2021-10-26T13:50:58.606Z] >>> [apiv2][query] DELETE https://us.gcr.io/v2/discovidapp/gcf/us-central1/135a2c4c-3a89-4a7b-9581-1f3e359cc771/manifests/latest [none]
[2021-10-26T13:50:59.218Z] <<< [apiv2][status] DELETE https://us.gcr.io/v2/discovidapp/gcf/us-central1/135a2c4c-3a89-4a7b-9581-1f3e359cc771/manifests/latest 202[2021-10-26T13:50:59.220Z] <<< [apiv2][body] DELETE https://us.gcr.io/v2/discovidapp/gcf/us-central1/135a2c4c-3a89-4a7b-9581-1f3e359cc771/manifests/latest {"errors":[]}
[2021-10-26T13:50:59.326Z] <<< [apiv2][status] GET https://us.gcr.io/v2/discovidapp/gcf/us-central1/135a2c4c-3a89-4a7b-9581-1f3e359cc771/cache/tags/list 200
[2021-10-26T13:50:59.327Z] <<< [apiv2][body] GET https://us.gcr.io/v2/discovidapp/gcf/us-central1/135a2c4c-3a89-4a7b-9581-1f3e359cc771/cache/tags/list {"child":[],"manifest":{"sha256:ae025939085763b650e5cb08522db1f0b250cec2c8fb422f973434eeea57d42b":{"imageSizeBytes":"12167190","layerId":"","mediaType":"application/vnd.docker.distribution.manifest.v2 json","tag":["latest"],"timeCreatedMs":"315532801000","timeUploadedMs":"1635256222360"}},"name":"discovidapp/gcf/us-central1/135a2c4c-3a89-4a7b-9581-1f3e359cc771/cache","tags":["latest"]}
[2021-10-26T13:50:59.330Z] >>> [apiv2][query] DELETE https://us.gcr.io/v2/discovidapp/gcf/us-central1/135a2c4c-3a89-4a7b-9581-1f3e359cc771/cache/manifests/latest [none]
[2021-10-26T13:51:00.136Z] <<< [apiv2][status] DELETE https://us.gcr.io/v2/discovidapp/gcf/us-central1/135a2c4c-3a89-4a7b-9581-1f3e359cc771/manifests/app_version-9 202
[2021-10-26T13:51:00.139Z] <<< [apiv2][body] DELETE https://us.gcr.io/v2/discovidapp/gcf/us-central1/135a2c4c-3a89-4a7b-9581-1f3e359cc771/manifests/app_version-9 {"errors":[]}
[2021-10-26T13:51:00.142Z] >>> [apiv2][query] DELETE https://us.gcr.io/v2/discovidapp/gcf/us-central1/135a2c4c-3a89-4a7b-9581-1f3e359cc771/manifests/sha256:e6ae0ee7556ad1612c20b339c675eb0abd06caa1511ed4f2f5487fb2f48c3558 [none]
[2021-10-26T13:51:00.335Z] <<< [apiv2][status] DELETE https://us.gcr.io/v2/discovidapp/gcf/us-central1/135a2c4c-3a89-4a7b-9581-1f3e359cc771/cache/manifests/latest 202
[2021-10-26T13:51:00.336Z] <<< [apiv2][body] DELETE https://us.gcr.io/v2/discovidapp/gcf/us-central1/135a2c4c-3a89-4a7b-9581-1f3e359cc771/cache/manifests/latest {"errors":[]}
[2021-10-26T13:51:00.338Z] >>> [apiv2][query] DELETE https://us.gcr.io/v2/discovidapp/gcf/us-central1/135a2c4c-3a89-4a7b-9581-1f3e359cc771/cache/manifests/sha256:ae025939085763b650e5cb08522db1f0b250cec2c8fb422f973434eeea57d42b [none]
[2021-10-26T13:51:02.386Z] <<< [apiv2][status] DELETE https://us.gcr.io/v2/discovidapp/gcf/us-central1/135a2c4c-3a89-4a7b-9581-1f3e359cc771/cache/manifests/sha256:ae025939085763b650e5cb08522db1f0b250cec2c8fb422f973434eeea57d42b 202
[2021-10-26T13:51:02.388Z] <<< [apiv2][body] DELETE https://us.gcr.io/v2/discovidapp/gcf/us-central1/135a2c4c-3a89-4a7b-9581-1f3e359cc771/cache/manifests/sha256:ae025939085763b650e5cb08522db1f0b250cec2c8fb422f973434eeea57d42b {"errors":[]}
[2021-10-26T13:51:02.900Z] <<< [apiv2][status] DELETE https://us.gcr.io/v2/discovidapp/gcf/us-central1/135a2c4c-3a89-4a7b-9581-1f3e359cc771/manifests/sha256:e6ae0ee7556ad1612c20b339c675eb0abd06caa1511ed4f2f5487fb2f48c3558 202
[2021-10-26T13:51:02.902Z] <<< [apiv2][body] DELETE https://us.gcr.io/v2/discovidapp/gcf/us-central1/135a2c4c-3a89-4a7b-9581-1f3e359cc771/manifests/sha256:e6ae0ee7556ad1612c20b339c675eb0abd06caa1511ed4f2f5487fb2f48c3558 {"errors":[]}
[2021-10-26T13:51:02.906Z] Error: Failed to update function app in region us-central1
    at C:\Users\tomdu\AppData\Roaming\npm\node_modules\firebase-tools\lib\deploy\functions\release\fabricator.js:35:11
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async Fabricator.updateV1Function (C:\Users\tomdu\AppData\Roaming\npm\node_modules\firebase-tools\lib\deploy\functions\release\fabricator.js:227:32)     
    at async Fabricator.updateEndpoint (C:\Users\tomdu\AppData\Roaming\npm\node_modules\firebase-tools\lib\deploy\functions\release\fabricator.js:131:13)       
    at async handle (C:\Users\tomdu\AppData\Roaming\npm\node_modules\firebase-tools\lib\deploy\functions\release\fabricator.js:72:17)

Error: There was an error deploying functions
  • Related