WebPlatform: Cannot read property 'audio' of undefined


#1

We have built a Jovo app for use on:

  • Amazon Alexa
  • Google Assistant - Conversational Actions
  • Web Platform - Vue

Here’s how we initialize the Jovo app:

const { App } = require('jovo-framework');
const { GoogleAssistant } = require('jovo-platform-googleassistantconv');
const { Alexa } = require('jovo-platform-alexa');
const { WebPlatform } = require('jovo-platform-web');
const { NlpjsNlu } = require('jovo-nlu-nlpjs');
const { FileDb } = require('jovo-db-filedb');
const { JovoDebugger } = require('jovo-plugin-debugger');
// ------------------------------------------------------------------
// APP INITIALIZATION
// ------------------------------------------------------------------

const app = new App();

const webPlatform = new WebPlatform();
webPlatform.use(new NlpjsNlu());
app.use(new FileDb(), new Alexa(), new GoogleAssistant(), new JovoDebugger());
if (!process.env.JEST_WORKER_ID) {
  app.use(webPlatform);
}

When I LAUNCH the app on Amazon Alexa, I get the following verbal response:

“There was a problem with the requested skill’s response”

Then, in the Jovo server logs, I see some strange things:

  • No request logged.
  • No response logged.
  • Error message:
TypeError: Cannot read property 'audio' of undefined
      at WebPlatform.request (/home/path/assistant/node_modules/jovo-platform-core/src/CorePlatform.ts:98:81)

the WebPlatform part was weird to me.

What is causing WebPlatform error?

I am launching this app from an Amazon Echo Show 5. What is causing WebPlatform to be triggered at all?

Solution, for now, seems to be to remove ALL WebPlatform code into it’s own Lambda Function so as not to interfere with normal functionings of Amazon Alexa Skills.

Updated src/app.js

const { App } = require('jovo-framework');
const { GoogleAssistant } = require('jovo-platform-googleassistantconv');
const { Alexa } = require('jovo-platform-alexa');
// const { WebPlatform } = require('jovo-platform-web');
// const { NlpjsNlu } = require('jovo-nlu-nlpjs');
const { FileDb } = require('jovo-db-filedb');
const { JovoDebugger } = require('jovo-plugin-debugger');
// ------------------------------------------------------------------
// APP INITIALIZATION
// ------------------------------------------------------------------

const app = new App();

// const webPlatform = new WebPlatform();
// webPlatform.use(new NlpjsNlu());
app.use(new FileDb(), new Alexa(), new GoogleAssistant(), new JovoDebugger());
if (!process.env.JEST_WORKER_ID) {
  // app.use(webPlatform);
}

#2

Opened Github Issue here as well for
@jan
@AlexSwe