question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Crash on sending .suggestedActions with builder.Message()

See original GitHub issue

Added task list based on below discussion.


Earlier similar issue: #10

Follow messages popsup in emulator: [16:09:33] [err-client] Uncaught TypeError: Cannot read property 'length' of undefined /Applications/botframework-emulator.app/Contents/Resources/app/node_modules/rxjs/Subscriber.js 227 13 {}

Development environment:

  • Run on localhost on http://localhost:3978/api/messages
  • Bot Framework Emulator version 3.5.29
  • "botbuilder": "^3.8.3"
  • example: Add suggested actions to message on Bot Framework documentation

Code:

// LUIS intent declaration 
const recognizer = new builder.LuisRecognizer(LuisRestFilterModelUrl);
const intents = new builder.IntentDialog({ 'recognizers': [recognizer] });
bot.dialog('/', intents);
intents.onBegin(
    (session,args) => {
       let msg = new builder.Message(session)
            .text("Thank you. Short message.")
            .suggestedActions([
                builder.CardAction.imBack(session, "productId=1&color=green", "Green"),
                builder.CardAction.imBack(session, "productId=1&color=blue", "Blue"),
                builder.CardAction.imBack(session, "productId=1&color=red", "Red")
            ]);
        session.send(msg);
      }
      );

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
eanders-mscommented, May 17, 2017

And it seems our documentation is incorrect on the page you referenced. We’ll get that updated. Thank you for the report!

1reaction
eanders-mscommented, May 17, 2017

Hi @ronak-itility, it seems your suggested actions payload isn’t getting constructed correctly. Try this slight variation (based on https://github.com/Microsoft/BotBuilder/tree/master/Node/examples/feature-suggestedActions):

    let msg = new builder.Message(session)
        .text("Thank you. Short message.")
        .suggestedActions(
            builder.SuggestedActions.create(
                    session, [
                        builder.CardAction.imBack(session, "productId=1&color=green", "Green"),
                        builder.CardAction.imBack(session, "productId=1&color=blue", "Blue"),
                        builder.CardAction.imBack(session, "productId=1&color=red", "Red")
                    ]
                ));
    session.send(msg);
Read more comments on GitHub >

github_iconTop Results From Across the Web

IME may crash when processing a window message sent from ...
Describes a scenario where an Input Method Editor (IME) crashes while processing a window message sent from another thread, and where the ...
Read more >
discord - Bot crashing immediately after sending an embed
EDIT: and as a side note the error originated where you called a new embed but didn't give any values for it. const...
Read more >
Send Slack notification when Windows program crashes?
Yes, Slack can receive messages in real-time using the Incoming Webhooks. It only requires an internet access for your app or monitoring ...
Read more >
Housing Prices are About to Crash (and Builders ... - YouTube
Building permits are crashing which is a leading indicator that the housing market is about to burst. While experts believe higher interest ...
Read more >
Federal agency sends team to probe Tesla crash that killed 3
In addition to the specific crashes, NHTSA has investigations underway into ... A message was left Wednesday seeking comment from Tesla, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found