Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webchat JS code does not work on IE #1662

Closed
raghukrishnamoorthy opened this issue Jan 30, 2019 · 12 comments
Closed

Webchat JS code does not work on IE #1662

raghukrishnamoorthy opened this issue Jan 30, 2019 · 12 comments
Labels
question Further information is requested. Stack Overflow candidate

Comments

@raghukrishnamoorthy
Copy link

I'm using the sample code from the Readme page with the secret for my bot in my web page. works fine on chrome and firefox. In IE, I get a Promise related error and the bot does not load.

@raghukrishnamoorthy
Copy link
Author

This is the error that I get on the web developer console:

.......
'Promise' is undefined
.......

@nt-7
Copy link
Contributor

nt-7 commented Jan 30, 2019

Hi @raghukrishnamoorthy,
Is your target IE11? Do you use Web Chat CDN?

In case of ES5 browsers like IE11, you need to use Web Chat CDN with ES5 polyfills (webchat-es5.js).

Sample - Getting started with Web Chat CDN with ES5 polyfills

For example, you should rewrite such us the following code, so I guess it works.

+ <script src="https://cdn.botframework.com/botframework-webchat/master/webchat-es5.js"></script>
- <script src="https://cdn.botframework.com/botframework-webchat/master/webchat.js"></script>

@corinagum
Copy link
Contributor

thanks @nt-7 for the help.
Please see #1489 for more information.

@corinagum corinagum added the Duplicate This issue or pull request already exists label Jan 30, 2019
@raghukrishnamoorthy
Copy link
Author

After replacing the new cdn link for es5 i'm getting a "Refused to set unsafe header "User-Agent" error on chrome on every message sent to the bot.

Also, the CSS classes for all the controls are completely different from the CSS classes that you get when you use the non es5 cdn link.

What do i do now?

@raghukrishnamoorthy
Copy link
Author

Also the es5 cdn has a missing feature that is present in the latest/webchat.js cdn link. It has new directLine method signature with conversation Id and secret/token as parameters instead of just secret/token. Which CDN do i use now?

@corinagum corinagum added question Further information is requested. Stack Overflow candidate Pending and removed Duplicate This issue or pull request already exists labels Jan 31, 2019
@corinagum
Copy link
Contributor

@raghukrishnamoorthy could you share both CDN links that you were using?

Regarding your comment about the CSS classes, I'm not sure what would cause this. Is it possible you used /botchat-es5.js/ instead of /webchat-es5.js/? For your second comment, it sounds like you may be using /latest/ for the webchat.js and /master/ for the es5 build, but I'd like to confirm.

@compulim could you weigh in on the User-Agent errors?

@corinagum corinagum reopened this Jan 31, 2019
@raghukrishnamoorthy
Copy link
Author

raghukrishnamoorthy commented Jan 31, 2019

  1. This was the CDN giving me the user agent error on chrome.
<script src="https://cdn.botframework.com/botframework-webchat/master/webchat-es5.js"></script>
  1. This was the CDN I was already using
<script src="https://cdn.botframework.com/botframework-webchat/master/webchat.js"></script>
  1. And this is the recommended CDN for direct line that takes the conversation ID parameter in addition to secret/token.
<script src="https://cdn.botframework.com/botframework-webchat/latest/webchat.js"></script>

Sorry for the formatting mess. I'm on mobile.

@corinagum
Copy link
Contributor

Thanks @raghukrishnamoorthy.

Also the es5 cdn has a missing feature that is present in the latest/webchat.js cdn link. It has new directLine method signature with conversation Id and secret/token as parameters instead of just secret/token. Which CDN do i use now?

Regarding your comment quoted above, I believe this has to do with using /latest/ versus /master/. We have had a few PR's improving the DL signature here and here.

Latest reflects our most recent official release (4.2), and does not include our most recent changes. If you are in need of those changes immediately, you are welcome to use this CDN: https://cdn.botframework.com/botframework-webchat/master/webchat-es5.js. Once we release 4.3, you are welcome to switch back to latest if you'd like.

When you have the chance, could you share a screencap of the differences in CSS classes between es5 and non-es5 link? I'm hoping this will help me figure out what's going on there.

@corinagum
Copy link
Contributor

Regarding the User-Agent issue, this is a bug in the DirectLine JS microsoft/BotFramework-DirectLineJS#152 and will be resolved in the /master/ bits once we get this PR merged in: #1676

@compulim compulim removed their assignment Jan 31, 2019
@raghukrishnamoorthy
Copy link
Author

Any idea on when this merge might happen?

@corinagum
Copy link
Contributor

#1676 was merged in a few days ago and master bits will have updated DLJS. latest will have these changes at our 4.3 release in a few weeks.

@raghukrishnamoorthy
Copy link
Author

@corinagum Fantastic. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested. Stack Overflow candidate
Projects
None yet
Development

No branches or pull requests

4 participants