Search code examples
javascriptangular9azure-app-configuration

angular azure app configuration giving SCRIPT1002: Syntax error in IE11


this is the line in IE11 console vendor.js (65816,1);

class AppConfigCredential {
constructor(credential, secret) {
    this.credential = credential;
    this.secret = secret;
}

Iam trying read the feature flags from azure appconfiguration from angular it's working fine for all the browsers except in IE11 i tried replacing polyfiles and by adding tsconfig-es5.app and changing in angular json as required but no use and calling function is.

enter code here
async GetFeatureToggleValue(key: any) {
   const client = new AppConfigurationClient(this.AppconfigURL);;
   return await client.getConfigurationSetting({ key: 
   ".appconfig.featureflag/" + key }, { onlyIfChanged: true }); }

Solution

  • The class keyword was introduced in ES2015/ES6. Internet Explorer 11 does not support ES6 and later versions of JavaScript. (Chrome is currently at ES12).

    You can use this SO answer to use babel to transpile your code to ES5.

    However, if possible try to avoid developing for IE11 itself, as it will be removed from Windows 10 in June 2022. (source: blog.windows.com)