Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read property 'map' of undefined #30

Open
a-j-n opened this issue Jun 16, 2019 · 3 comments
Open

Cannot read property 'map' of undefined #30

a-j-n opened this issue Jun 16, 2019 · 3 comments

Comments

@a-j-n
Copy link

a-j-n commented Jun 16, 2019

hello ,
every time i'm try to run this ButtonTemplate

public function AskForMoreInfo()
    {
        $list = ButtonTemplate::create(__('bot.chose_one'))
            ->addButton(
                ElementButton::create(__('bot.anther_search'))
                    ->type('postback')
                    ->payload('search')
            )
            ->addButton(
                ElementButton::create(__('bot.next_aya'))
                    ->type('postback')
                    ->payload('next_aya')
            );
        $this->ask($list, function (Answer $answer) {
            $this->say($answer->getText());
        });
    }

i'm facing this Cannot read property 'map' of undefined (chat.js:1)

Screen Shot 2019-06-16 at 3 26 54 AM

Screen Shot 2019-06-16 at 3 24 07 AM

Screen Shot 2019-06-16 at 3 24 20 AM

@a-j-n
Copy link
Author

a-j-n commented Jun 26, 2019

i found out if i have two ButtonTemplate at the same conversation only first one will work

@hnguyen303
Copy link

Have you had solution for that problem?

@walkoda
Copy link

walkoda commented Sep 2, 2020

In my case, the problem occurred when I was trying to list buttons after clicking other conversation buttons. The problem was this line: https://github.com/botman/web-widget/blob/master/src/chat/messages/action.tsx#L30. As you can see, a new object is created and buttons are not passed to the messageHandler function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants