【问题标题】:Bot Framework SDK 4.11 DialogContextError: Cannot read property 'trackTrace' of undefinedTypeError: Cannot read property 'trackTrace' of undefinedBot Framework SDK 4.11 DialogContextError:无法读取 undefinedTypeError 的属性“trackTrace”:无法读取未定义的属性“trackTrace”
【发布时间】:2021-01-14 12:57:31
【问题描述】:

更新 Microsoft botbuilder 和 botbuilder-dialog 版本 4.11.0 后,我遇到了错误。它适用于早期版本。

更新到 4.11.0 版本后遇到以下错误

{ TypeError: Cannot read property 'trackTrace' of undefined
  at Object.<anonymous> (/Users/ashokmanseta/Projects/botbuilder-adapter/node_modules/botbuilder-dialogs/src/dialogContainer.ts:49:40)
  at Generator.next (<anonymous>)
  at fulfilled (/Users/ashokmanseta/Projects/botbuilder-adapter/node_modules/botbuilder-dialogs/lib/dialogContainer.js:4:58)
  at process._tickCallback (internal/process/next_tick.js:68:7)
name: 'DialogContextError',
dialogContext:
 { activeDialog: 'dialog-0.2220127757',
   parent: undefined,
   stack: [ [Object] ] } }

如果有任何解决方法,请提供帮助。

【问题讨论】:

    标签: dialog botframework


    【解决方案1】:

    实际上,代码在为 dialogContainer 中的对话框检查遥测客户端时死掉了

    dc.dialogs.telemetryClient.trackTrace({
    message: traceMessage,
    severityLevel: botbuilder_core_1.Severity.Warning,
    });
    

    添加可以是 NullTelemetryClient 的遥测客户端

    检查您在主对话框上创建 dialogContext 的位置,

    //Example
    const dialogContext = await dialogSet.createContext(context);
    

    把这条线放在那里

    import { NullTelemetryClient } from "botbuilder";
    dialogContext.dialogs.telemetryClient=new NullTelemetryClient()
    

    【讨论】:

      猜你喜欢
      • 2021-08-29
      • 2020-06-20
      • 1970-01-01
      • 2019-03-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-04-06
      • 2023-03-11
      相关资源
      最近更新 更多