I’m having trouble with the Google Basic Card again.
My app has got rather large. Following the instructions in the Jovo docs, I decided to separate my Google and Alexa handlers into separate files like this:
const { App } = require("jovo-framework");
const { Alexa } = require("jovo-platform-alexa");
const { GoogleAssistant, BasicCard } = require("jovo-platform-googleassistant");
const { JovoDebugger } = require("jovo-plugin-debugger");
const { FileDb } = require("jovo-db-filedb");
const requestPromise = require("request-promise-native");
const AlexaHandler = require("./alexa/alexaHandler.js");
const GoogleHandler = require("./google/googleHandler.js");
const app = new App();
app.use(
new Alexa(),
new GoogleAssistant(),
new JovoDebugger(),
new FileDb()
);
and then:
app.setHandler({
... LAUNCH(), HelpIntent(), END() etc. ...
};
app.setAlexaHandler(AlexaHandler);
app.setGoogleAssistantHandler(GoogleHandler);
Everything works as usual but now, I get the following error in the logs:
ReferenceError: BasicCard is not defined
at GoogleAction.xxxxxxxIntent (/var/task/google/googleHandler.js:297:31)
It looks like app.js
can’t use the BasicCard constructor now I’ve separated my handlers into separate files. Before I separated them, and when they were all in app.js
, it was working perfectly. Any ideas on how I can resolve this?
Many thanks
-Simon