无效的尝试重构不可迭代的实例-Bot 4.0 WebChat.js

问题描述 投票:1回答:1

[[对象错误]:{消息:“无效地破坏不可迭代的尝试实例”,堆栈:“ TypeError:无效的破坏尝试e.exports上的不可迭代实例(https://cdn.botframework.com/botframework-webchat/latest/webchat.js:1:566613)在e.exports处t.unstable_runWithPriority(https://cdn.botframework.com/botframework-webchat/latest/webchat.js:1:351563)卢比(https://cdn.botframework.com/botframework-webchat/latest/webchat.js:1:339772)在Ps(https://cdn.botframework.com/botframework-webchat/latest/webchat.js:1:339567)“}

 (async function () {
        const res = await fetch('https://tokenservice/api/DLToken', { method: 'POST' });        
        const {token}  = await res.json();
        console.log({token});
        window.WebChat.renderWebChat(
            {
                bot: bot,
                directLine: window.WebChat.createDirectLine({token}),
                user: user,
                speechOptions: speechOptions,
                resize: 'detect',
                styleOptions: styleOptions
            },
            document.getElementById('BotChatGoesHere')
        );

我在Edge和IE中遇到此错误,在Chrome中正常运行。请提出解决方案,有义务。

botframework bots microsoft-edge direct-line-botframework web-chat
1个回答
0
投票

IE 11不支持async/await关键字。我们需要在IE中使用es5捆绑软件。请尝试改用https://cdn.botframework.com/botframework-webchat/latest/webchat-es5.js

参考:

Latest WebChat : IE11 Compatibility

Sample - Getting Started with Web Chat CDN with ES5 Polyfills

最新问题
© www.soinside.com 2019 - 2024. All rights reserved.