如何解决Yo Teams Generator和botbuilder-js SDK问题
使用yo team生成器的默认安装,生成的代码有效。 将botbuilder-js SDK升级到最新版本(4.10.0)会破坏此原始代码。
具体在第33和34行是生成的myBot.ts文件中的以下代码:
33 this.dialogState = conversationState.createProperty("dialogState");
34 this.dialogs = new DialogSet(this.dialogState);
然后在这一行:
49 const dc = await this.dialogs.createContext(context);
VS Code没有发现错误。
然后我将botbuilder-js SDK升级到最新(4.10.0)和代码的第34行:
this.dialogs = new DialogSet(this.dialogState);
标记一个错误:
Argument of type 'import("…/Development/myBot/node_modules/botbuilder/node_modules/botbuilder-core/lib/botStatePropertyAccessor").StatePropertyAccessor<import("…/Development/myBot/node_modules/botbuilder-dialogs/lib/dialogContext").DialogState>' is not assignable to parameter of type 'import("…/Development/myBot/node_modules/botbuilder-core/lib/botStatePropertyAccessor").StatePropertyAccessor<import("…/Development/myBot/node_modules/botbuilder-dialogs/lib/dialogContext").DialogState>'.
Types of property 'delete' are incompatible.
第49行:
this.dialogs = new DialogSet(this.dialogState);
出现此错误:
Type '(context: import("…/Development/myBot/node_modules/botbuilder/node_modules/botbuilder-core/lib/turnContext").TurnContext) => Promise<...>' is not assignable to type '(context: import("…/Development/myBot/node_modules/botbuilder-core/lib/turnContext").TurnContext) => Promise<void>'.
Types of parameters 'context' and 'context' are incompatible.
Property 'bufferedReplyActivities' is missing in type 'import("…/Development/myBot/node_modules/botbuilder-core/lib/turnContext").TurnContext' but required in type 'import("…/Development/myBot/node_modules/botbuilder/node_modules/botbuilder-core/lib/turnContext").TurnContext'.
对于这种环境,我太陌生了,不知道发生了什么事。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。