Hi
i need load data from url before launch because i wish to set global array from ours data event
but i have this error
Error -----------------------------------------------------------------
Message:
Converting circular structure to JSON
--> starting at object with constructor 'ClientRequest'
| property 'socket' -> object with constructor 'TLSSocket'
--- property '_httpMessage' closes the circle
Stack:
TypeError: Converting circular structure to JSON
--> starting at object with constructor 'ClientRequest'
| property 'socket' -> object with constructor 'TLSSocket'
--- property '_httpMessage' closes the circle
at JSON.stringify (<anonymous>)
at stringify (/home/sylvain/sap/sap_tdd_jovo_2020-08-15_1000/node_modules/express/lib/response.js:1123:12)
at ServerResponse.json (/home/sylvain/sap/sap_tdd_jovo_2020-08-15_1000/node_modules/express/lib/response.js:260:14)
at /home/sylvain/sap/sap_tdd_jovo_2020-08-15_1000/node_modules/jovo-framework/src/hosts/ExpressJS.ts:45:18
at new Promise (<anonymous>)
at ExpressJS.setResponse (/home/sylvain/sap/sap_tdd_jovo_2020-08-15_1000/node_modules/jovo-framework/src/hosts/ExpressJS.ts:43:12)
at Alexa.response (/home/sylvain/sap/sap_tdd_jovo_2020-08-15_1000/node_modules/jovo-platform-alexa/src/Alexa.ts:188:30)
at Middleware.run (/home/sylvain/sap/sap_tdd_jovo_2020-08-15_1000/node_modules/jovo-core/src/core/Middleware.ts:85:11)
at App.handle (/home/sylvain/sap/sap_tdd_jovo_2020-08-15_1000/node_modules/jovo-core/src/core/BaseApp.ts:291:7)
at App.handle (/home/sylvain/sap/sap_tdd_jovo_2020-08-15_1000/node_modules/jovo-framework/src/App.ts:333:5)
and script use
async ON_REQUEST() {
const todayFormat = new Date().toLocaleString("fr-FR", {
year: "numeric",
month: "2-digit",
day: "2-digit"
});
const url = 'https://localhost:3000';
this.$session.$data.sapEvent = await HttpService.get(url);
},
LAUNCH() {
const title = this.$session.$data.sapEvent.data.data[0].title
let speech = "bienvenue sur SAP, voulez sortir ? " + title;
let reprompt = 'nom d une sortie ou une categorie.';
this.ask(speech, reprompt);
},
how to avoid this issue ?