0

I am working with lit-html templating library, ParcelJs bundler using Typescript, compiling in to ES2019. With such I am creating a js library to be consumed by consuming applications. This works great on most browser excepts in IE11. I get the following error:

SCRIPT1002: Syntax error

which is:

export const directive = <F extends DirectiveFactory>(f: F): F =>

I suspect though its an issue with version of JS and using lit-html.

Is there a workaround/fix that can be introduced to rectify the issues with IE11? Any tips or guidance would be great.

amateur
  • 43,371
  • 65
  • 192
  • 320

1 Answers1

0

I can see that line of code has => Arrow function.

An arrow function is not supported in IE 11 browser.

enter image description here

You need to transpile your code to ES 5 to make it work in IE 11 browser.

You can use Babel.js to transpile the code.

You can also try to check this Babel plugin

Deepak-MSFT
  • 10,379
  • 1
  • 12
  • 19
  • @amateur, can you please inform the status of this issue? If the above answer solved the issue, then please try to accept the answer. If you found the solution by yourself then try to post your solution as an answer. If the issue still persists then let us know about the current status for the issue. Thanks for your understanding. – Deepak-MSFT Apr 20 '20 at 07:24