Botframework-sdk: [Bug] Always typeError: Cannot read property 'logger' of undefined

Created on 17 Jul 2017  路  2Comments  路  Source: microsoft/botframework-sdk

Hi all. I'm always got this error.

System Information (Required)

Issue Description

Code Example

import * as restify from 'restify';
import {config} from './Services/Config';
import * as builder from 'botbuilder';
import {gitlabNotifyHandler} from "./Commands/Gitlab/Notify";
import {IntentDialog, Session} from "botbuilder";
import {SkypeLuisRecognizer} from "./Services/LuisRecognizer";
import {helpDialog} from "./Commands/Interaction/HelpDialog";
import {contactSyncHelper} from "./Helpers/ContactSync";
import {noneDialog} from "./Commands/Interaction/NoneDialog";

const server = restify.createServer();

server.listen(config.getServer().getPort(), () => {
    console.log(`Listen: ${config.getServer().getPort()}`);
});


const connector = new builder.ChatConnector({
    appId: config.getSkypeBot().getId(),
    appPassword: config.getSkypeBot().getPassword()
});

const bot = new builder.UniversalBot(connector);

server.post('/api/messages', connector.listen());
server.get('/gitlab/notify/text/:text', gitlabNotifyHandler(bot));

bot.on('incoming', contactSyncHelper);

let intents = new IntentDialog({
    recognizers: [SkypeLuisRecognizer],
    recognizeOrder: builder.RecognizeOrder.series
})
    .matches('Help', [helpDialog])
    .matches('None',[noneDialog]);

bot.dialog('/', intents);

Steps to Reproduce the Issue

  1. write code
  2. run code
  3. see on error

Expected Behavior

Dialog must run

Actual Results

/home/user/Projects/Pet/skype-bot-ci/node_modules/promise/lib/done.js:10
throw err;
^

TypeError: Cannot read property 'logger' of undefined
at UniversalBot.Library.findActiveDialogRoutes (/home/user/Projects/Pet/skype-bot-ci/node_modules/botbuilder/lib/bots/Library.js:135:20)
at /home/user/Projects/Pet/skype-bot-ci/node_modules/botbuilder/lib/bots/Library.js:243:31
at /home/user/Projects/Pet/skype-bot-ci/node_modules/async/lib/async.js:718:13
at async.forEachOf.async.eachOf (/home/user/Projects/Pet/skype-bot-ci/node_modules/async/lib/async.js:233:13)
at _parallel (/home/user/Projects/Pet/skype-bot-ci/node_modules/async/lib/async.js:717:9)
at Object.async.parallel (/home/user/Projects/Pet/skype-bot-ci/node_modules/async/lib/async.js:731:9)
at /home/user/Projects/Pet/skype-bot-ci/node_modules/botbuilder/lib/bots/Library.js:241:23
at UniversalBot.Library.recognize (/home/user/Projects/Pet/skype-bot-ci/node_modules/botbuilder/lib/bots/Library.js:68:13)
at UniversalBot.Library.defaultFindRoutes (/home/user/Projects/Pet/skype-bot-ci/node_modules/botbuilder/lib/bots/Library.js:236:14)
at UniversalBot.Library.findRoutes (/home/user/Projects/Pet/skype-bot-ci/node_modules/botbuilder/lib/bots/Library.js:85:18)
at /home/user/Projects/Pet/skype-bot-ci/node_modules/botbuilder/lib/bots/UniversalBot.js:374:21
at /home/user/Projects/Pet/skype-bot-ci/node_modules/async/lib/async.js:181:20
at Object.async.forEachOf.async.eachOf (/home/user/Projects/Pet/skype-bot-ci/node_modules/async/lib/async.js:233:13)
at Object.async.forEach.async.each (/home/user/Projects/Pet/skype-bot-ci/node_modules/async/lib/async.js:209:22)
at /home/user/Projects/Pet/skype-bot-ci/node_modules/botbuilder/lib/bots/UniversalBot.js:373:19
at UniversalBot.Library.recognize (/home/user/Projects/Pet/skype-bot-ci/node_modules/botbuilder/lib/bots/Library.js:68:13)

bug

All 2 comments

Duplicate of #2846, ctx not declared when called in else statement. Fix filed in PR #3128.

Closing this issue for now, feel free to reopen if the PR does not resolve it

Was this page helpful?
0 / 5 - 0 ratings