Gcloud deploy function error code 3

I am doing a basic execution tutorial and setting up a conversation api.ai tutorial to make a bot for facebook messenger, and when I try to deploy a function using the command:

gcloud beta functions deploy testBot --stage-bucket testbot-e9bc4.appspot.com --trigger-http 

(where "testBot" is the name of the project, and "testbot-e9bc4.appspot.com" is the name bucket_name, I thought ..) It returns the following error message:

 ERROR: (gcloud.beta.functions.deploy) OperationError: code=3, message=Source code size exceeds the limit 

I searched, but did not find the answer, I do not know where the error is. This is the JS file that appears in the tutorial:

  / HTTP Cloud Function. @param {Object} req Cloud Function request context. @param {Object} res Cloud Function response context. */ exports.helloHttp = function helloHttp (req, res) { response = "This is a sample response from your webhook!" //Default response from the webhook to show it working res.setHeader('Content-Type', 'application/json'); //Requires application/json MIME type res.send(JSON.stringify({ "speech": response, "displayText": response //"speech" is the spoken version of the response, "displayText" is the visual version })); }; 
+6
source share
2 answers

Before you run gcloud beta functions deploy testBot --stage-bucket testbot-e9bc4.appspot.com --trigger-http make sure you are in the correct directory where your gcloud beta functions deploy testBot --stage-bucket testbot-e9bc4.appspot.com --trigger-http .

0
source

Open a command prompt at the location where index.js was created and run the gcloud command above.

-2
source

Source: https://habr.com/ru/post/1269385/


All Articles