I'm using fetch
and have included the whatwg-fetch
polyfill in my application.
I also employ TextDecoder
as described in Jake Archibald's blog That's so fetch! to decode the response, but I'm not sure what polyfill to use.
(Currently Safari complains about ReferenceError: Can't find variable: TextDecoder
)
I'm guessing there's a polyfill for TextDecoder
, but I'm not finding it...
Nowadays you can use the FastestSmallestTextEncoderDecoder polyfill (1.5 KB), as recommended by the MDN website.
I was able to solve this problem by using the text-encoding
library
npm install text-encoding --save
along with
import encoding from 'text-encoding';
const decoder = new encoding.TextDecoder();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With