Botbuilder-js: TypeError: builder.ConsoleConnector is not a constructor

Created on 2 Oct 2018  路  1Comment  路  Source: microsoft/botbuilder-js

Versions

Package version of the SDK: botbuilder V4.0.6
Nodejs version: Node V8.11.1
OS: Windows

Describe the bug

Error Message:
let connector = new builder.ConsoleConnector().listen();

TypeError: builder.ConsoleConnector is not a constructor
at Object. (C:UsersdebukDesktopstackoverflowapp.js:3:17)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:188:16)
at bootstrap_node.js:609:3

Code:

const builder = require("botbuilder");

let connector = new builder.ConsoleConnector().listen();
let bot = new builder.UniversalBot(connector, function(session) {
session.send("You said: %s", session.message.text);
});

To Reproduce

node app.js

Reference Microsoft Doc

https://docs.microsoft.com/en-us/azure/bot-service/nodejs/bot-builder-nodejs-quickstart?view=azure-bot-service-3.0&viewFallbackFrom=azure-bot-service-4.0

Most helpful comment

Well, figured it out by myself!

There is a mismatch between the documentation and the latest release of the botbuilder package (version 4.0.6)!

The code present in the Doc will only work for botbuilder package version less than 4.0.6 it seems.

For my case, I have installed [email protected] and it works perfectly fine!

Guys, please update the doc if the standard features have been changed / modified!!

Thanks!

>All comments

Well, figured it out by myself!

There is a mismatch between the documentation and the latest release of the botbuilder package (version 4.0.6)!

The code present in the Doc will only work for botbuilder package version less than 4.0.6 it seems.

For my case, I have installed [email protected] and it works perfectly fine!

Guys, please update the doc if the standard features have been changed / modified!!

Thanks!

Was this page helpful?
0 / 5 - 0 ratings