0

To load a Polymer element in IE11, we should compile it to es5 syntax, and to use the same file in Chrome we need custom-elements-es5-adapter.js.

custom-elements-es5-adapter.js cannot be used on IE11 as it is supposed to be in es6 syntax.

Its kind of a deadlock situation where a single bundle js cannot be loaded on both Chrome and IE11.

Is there a way a Polymer element can be used on IE11 and Chrome?

Sanjeev
  • 855
  • 1
  • 9
  • 15

1 Answers1

1

Custom Elements cannot work without native support, which IE11 does not have, the adapter is necessary just for shipping transpiled ES5 code to browsers which does have native support (as custome elements are ES6 classes). Transpilation to ES5 may be needed because of minification, tooling support, using ES7 features, etc. but nonetheless the target browser need to have native support for Custom Elements. So the adapter just enables declaring Custom Elements in ES5 way, it does not enable the feature itself.

See this discussion on workarounds for IE11 sytax error when the adapter is involved on polymer-cli's github: IE11 syntax error in custom-elements-es5-adapter.

Tomas Varga
  • 1,432
  • 15
  • 23