readConvos error: TypeError: Converting circular structure to JSON
See original GitHub issueIssue Description
This error appears when I run like this: testmybot-master/samples/watson$ npm run emulatorBrowser
readConvos error: TypeError: Converting circular structure to JSON
I found which place throws error:
/samples/watson/node_modules/testmybot/src/emulator/browser/index.js
router.route('/testcases')
.post(function(req, res) {
if (!req.body.header || !req.body.header.name)
return res.json({ success: false, error: 'Name not specified' });
if (!req.body.conversation)
return res.json({ success: false, error: 'Conversation not specified' });
try {
const filename = tmb.convoReader.writeConvo(req.body, true);
return res.json({ success: true, filename: filename });
} catch (err) {
console.log('writeConvo error: ' + err);
return res.json({ success: false, error: err });
}
}).get(function(req, res) {
try {
const convos = tmb.convoReader.readConvos()
return res.json(convos); // <---- This line says "TypeError: Converting circular structure to JSON"
} catch (err) {
console.log('readConvos error: ' + err);
return res.json({ success: false, error: err });
}
});
I’ve logged convos value before throwing error, this is convos’s value:
[ Convo {
provider:
ScriptingProvider {
caps: [Object],
compilers: [Object],
convos: [Circular],
utterances: {},
match: [Function],
scriptingEvents: [Object] },
header: ConvoHeader { name: 'testt_1', order: 1, description: undefined },
conversation: [ [Object], [Object], [Object], [Object] ],
sourceTag: 'testt_1.convo.txt' },
Convo {
provider:
ScriptingProvider {
caps: [Object],
compilers: [Object],
convos: [Circular],
utterances: {},
match: [Function],
scriptingEvents: [Object] },
header: ConvoHeader { name: 'testt_2', order: 2, description: undefined },
conversation:
[ [Object],
[Object],
[Object],
[Object],
[Object],
[Object],
[Object] ],
sourceTag: 'testt_2.convo.txt' } ]
>npm run emulator works fine, only >npm run emulatorBrowser throws above error. Browser opens http://127.0.0.1:3000/#!/testsuite but there is nothing to do there, busy loader rotates. I’m using nodejs v6.9.5, npm 3.10.10, kubuntu 16.04
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
12D1D06F1C6EE368DB6E8F67...
Filename: 12D1D06F1C6EE368DB6E8F67BD7E1C803F571B841450DEBCC68E4674F17D76B3.exe; Size: 26MiB (27348536 bytes); Type: peexe executable ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Great news! Just tried it and it generated multiple *.convo.txt and *.utterances.txt files. I’ve uploaded one pair of them. ok_input.utterances.txt ok.convo.txt I don’t know how to use them so far. I look usage deeply later from botium-cli.
Added the browser emulator to the botium-cli as well.