Genvid Forum

'TextDecoder' is not defined - IE / Edge support


#1

Hey everyone,

due to some external requirements we’re working on support for IE and Edge. This is sadly a requirement for us. When trying to instantiate Genvid in Edge or IE, we get the following exception:

ReferenceError: 'TextDecoder' is not defined
   at t (https://localhost.example.com:8080/app.da29769d5e937015cfef.js:36539:46457)
   at e.createGenvidClient (https://localhost.example.com:8080/app.da29769d5e937015cfef.js:36539:57070)
   at Anonymous function (https://localhost.example.com:8080/app.da29769d5e937015cfef.js:7708:21)
   at step (https://localhost.example.com:8080/app.da29769d5e937015cfef.js:7667:13)
   at Anonymous function (https://localhost.example.com:8080/app.da29769d5e937015cfef.js:7648:46)
   at fulfilled (https://localhost.example.com:8080/app.da29769d5e937015cfef.js:7639:43)

This maps to the the marked line (formatted by the browser):

The problem is that TextDecoder is not supported by IE / Edge, see:

We’ll be looking into polyfills for temporary support, but does genvid support IE11/Edge in general? Admittedly I haven’t looked to deeply, but I haven’t found any browser-support list.

Best,

Moritz


#2

Hi Moritz!

The team is looking into this and will respond shortly.

Best,

Pierre


#3

Thanks for the report,

We are looking to provide a polyfill for this one in a patch version we’re preparing.


#4

The fix/polyfill that I found worked in IE and Edge was:

import { TextDecoder } from 'text-encoding';
if (!window['TextDecoder']) {
  window['TextDecoder'] = TextDecoder;
}

Using the text-encoding npm package.


#5

Thanks Moritz for your suggestion,

We have test it and it works well, but also figure out it that we don’t really need it anymore, and removed it from SDK-1.15.1, with a more robust API.

Thanks for all your effort with our SDK, it really help us a lot in providing a better experience to our community,

Fabien