Azure-Samples/ms-identity-javascript-v2

IE11 ES6 Syntax Error for =>

godwin3737 opened this issue · 4 comments

Please follow the issue template below. Failure to do so will result in a delay in answering your question.

Library

  • @azure/msal-browser@2.x.x

Important: Please fill in your exact version number above, e.g. msal@2.1.3.

Framework

Description

The sample doesnt work on IE 11, throws syntax error on ES6 comptatiblity for =>

Error Message

Syntax error

Security

  • Is this issue security related?

Regression

  • Did this behavior work before?

Version:

MSAL Configuration

// Provide configuration values here.
// For Azure B2C issues, please include your policies.

Reproduction steps

// Provide relevant code snippets here.
// For Azure B2C issues, please include your policies.

Expected behavior

Tried babel polyfill , but tht doesnt seem to fix the issue.

Browsers/Environment

  • Chrome
  • Firefox
  • Edge
  • Safari
  • [x ] IE
  • Other (Please add browser name here)

error

Our samples use ES6 conventions, in particular promises, arrow functions and template literals. As such, they will not work on IE 11 out-of-the-box. For promises, you need to add a polyfill, e.g.:

<head>
   <!-- adding pollyfil for promises on IE11  -->
      <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/js-polyfills/0.1.42/polyfill.min.js"> 
   </script>
</head>

For arrow functions and template literals, you need to transpile them to older JavaScript. You can use this tool to help with the process.

Should I create a PR with the changes to this sample ?

@godwin3737 we would rather keep this sample in ES6. For a sample compatible with IE11, please check out this.

That works for me @derisen , Thanks!