TypeError: Cannot read properties of undefined (reading 'length')
Closed this issue · 6 comments
A1tura commented
I get that error when use conversation.wait()
: TypeError: Cannot read properties of undefined (reading 'length')
A1tura commented
Full log:
TypeError: Cannot read properties of undefined (reading 'length')
at ConversationControls.ctx.conversation.enter (/home/xxx/xxx/xxx/xxx/xxx/node_modules/@grammyjs/conversations/out/conversation.js:357:46)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
KnorpelSenf commented
Can you clear your session data and try again?
algorifer commented
@KnorpelSenf Hi, I have the same problem. I cleaned the session, but the problem still appears.
error: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'length')
if (session.conversation[id].length === 0) {
^
at ConversationControls.ctx.conversation.enter (https://deno.land/x/grammy_conversations@v1.2.0/conversation.ts:595:46)
at eventLoopTick (ext:core/01_core.js:168:7)
at async ConversationControls.ctx.conversation.enter (https://deno.land/x/grammy_conversations@v1.2.0/conversation.ts:576:17)
KnorpelSenf commented
Ah. You just forgot to use await
when entering the conversation.
algorifer commented
Ah. You just forgot to use
await
when entering the conversation.
Yes, it worked for me. Thank you!
KnorpelSenf commented
You're welcome :)