Jovo deploy error "cannot read property 'uri' of undefined


#1

I have separated the API calling functions in a separate custom.js and using const custom = require('./custom.js).

Here is the skeleton of my js file:

const request = require("request-promise");
const accessToken = "xxxxxxx-xxxxxx";
const apiBase = "https://api.myapihandler/v1/";

module.exports = {
  email_search_result: async (deliveryType, resultType, status) => {
    let data = {};

    await request({
      url: apiBase + "emails/search",
      qs: {
        accessToken: accessToken,
        deliveryType: deliveryType,
        automatedResults: resultType,
        status: status
      },
      method: "GET"
    })
      .then(body => {
        data = JSON.parse(body);
      })
      .catch(error => {
        console.log(error);
      });

    return data;
  },
...
}

And calling these functions in app.js like this:

const custom = require('./custom.js');

app.setHandler({
    async EmailSearchIntent() {
         const result = custom.email_search_result;
         ...
    }
});

The above approach works fine when testing with JOVO debugger. So I went on to deploy to Alexa using jovo deploy and got the following error:

:heavy_multiplication_x: Updating Alexa Skill project for ASK profile default
-> Cannot read property ‘uri’ of undefined

Below is the complete console output:

:heavy_check_mark: Bundle Project
:heavy_check_mark: Copy source code to “./bundle”
:heavy_check_mark: Run “npm install --production”
:heavy_check_mark: Zip “./bundle” folder
-> Zip path: /var/www/alexa-skills/MarketingMetrics/bundle.zip
❯ Deploying Alexa Skill
:heavy_multiplication_x: Updating Alexa Skill project for ASK profile default
-> Cannot read property ‘uri’ of undefined
Deploying Interaction Model, waiting for build

I searched through the project and only find any occurrence of uri. Please see below the screenshot of the project-wide search result for uri.

I apologize for putting on too much of messages. I Googled first and come back here only after not been able to find an answer.


#2

Please disregard. I found it! In project.js I had this:

module.exports = {
  alexaSkill: {
    nlu: "alexa"
  },
  stages: {
     local: {
       endpoint: "${JOVO_WEBHOOK_URL}"
     },
     dev: {
       // Change to ARN when deployed to Lambda.
       endpoint: "${JOVO_WEBHOOK_URL}"
     }
   }
};

I changed it to just endpoint: "${JOVO_WEBHOOK_URL}". Will put ARN later.


closed #3