Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure BotFramework-WebChat javascript error initializing DirectLine

Following all the MS guidance I can find relating to web chat and directline, but I keep getting the following error no matter what I try from botchat.js:

Object doesn't support property or method 'webSocketActivity$'

Once I get the DirectLine connection I'll be following the backchannel example, but I must be missing something because I can't get past the above error. Here's my working code without my DirectLine channel secret:

<!DOCTYPE html>
<html>
<head>
    <link href="https://cdn.botframework.com/botframework-webchat/latest/botchat.css" rel="stylesheet" />
</head>
<body>
    <script src="https://cdn.botframework.com/botframework-webchat/latest/botchat.js"></script>
    <script>
        var botConnection = BotChat.DirectLine({ secret: <my secret> });
    </script>
    <div id="bot"></div>
</body>
</html>
like image 794
Kyle Avatar asked Sep 20 '26 10:09

Kyle


1 Answers

Please use new to create the directline connection instance:

var botConnection = new BotChat.DirectLine({ secret: <my secret> });
like image 51
Gary Liu Avatar answered Sep 22 '26 00:09

Gary Liu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!