Kyle
Kyle

Reputation: 33

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>

Upvotes: 3

Views: 452

Answers (1)

Gary Liu
Gary Liu

Reputation: 13918

Please use new to create the directline connection instance:

var botConnection = new BotChat.DirectLine({ secret: <my secret> });

Upvotes: 1

Related Questions