-
Notifications
You must be signed in to change notification settings - Fork 2.3k
convo.repeat() triggering error message #1673
Comments
I am having this issue too. For me it's happening after I begin a dialog based on the response of a question. I'm not too sure at what stage the actual error is happening though because it seems to randomly happen a couple of seconds after the question is answered.
|
I have a patch that will stop this from erroring, but I am struggling to find the root cause. Can either of you send me more information about the full structure of your dialog? |
I'm having the same issue. However, I'm getting the error TypeError: Converting circular structure to JSON. This is because Here is a simple BotkitConversation dialog that will produce this error. Please let me know if there's something wrong with my code, but I believe it's valid. To reproduce...
This should trigger a circular json error. const {BotkitConversation} = require('botkit')
module.exports = function(controller) {
const botConvo = new BotkitConversation('testConvo', controller)
botConvo.ask({
text: ['what is your name?'],
}, [
{
default: true,
handler: async (answer, convo, bot) => {
await bot.say(`hi ${answer}`)
},
},
], {key: 'name'})
botConvo.ask({
text: ['what is your last name'],
}
, [
{
pattern: 'smith',
handler: async (answer, convo, bot) => {
await bot.say('I like the name smith')
},
},
{
default: true,
handler: async (answer, convo, bot) => {
await bot.say('name not recognized, say another name')
await convo.repeat()
},
},
], {key: 'last-name'})
controller.addDialog(botConvo)
controller.on('some-event', async (bot, message) => {
await bot.beginDialog('testConvo')
})
} |
@c4ndybar I believe this is a different issue; I am having it too. I will open an issue for this specific case. |
Are you sure this is an issue with the Botkit core module?
I was running into issues with the convo.repeat() function. It wasn't working on certain questions and was working on others.
What are you trying to achieve or the steps to reproduce?
I get it on random questions and have tried numerous tests to figure out what is causing it but cannot determine the issue. I'm getting an error on conversation.js on line 498 indicating that step.result.match doesn't exist. I noticed that occasionally step.result is an object instead of a string and that is where it is having the issue. I outputted the result to show this.
conversation.js in lib
Result in console
Context:
The text was updated successfully, but these errors were encountered: