Reputation: 63
I'm using react native 0.72.4
I'm getting this error: Reference Error: Property 'Text Encoder' doesn't exist
at multiple places in my app. I didn't use it explicitly but my npm
packages like qr-code-svg
uses this package.
I don't know what Text Encoder is or where it is used .. i don't know why all of it occurs suddenly.
Upvotes: 6
Views: 2410
Reputation: 1607
Package text-encoding is no longer maintained. You should install a polyfill.
npm install text-encoding-polyfill
And include it at the top of your project.
// index.js
import 'text-encoding-polyfill'
Upvotes: 0
Reputation: 26
They have fixed this issue with version 6.3.2
Update to this version and everything should work fine.
Ref:
Upvotes: 1
Reputation: 51
this worked for me using same react native 0.72.4
install text-encoding using npm install --save text-encoding --legacy-peer-deps
then import it everywhere you have imported the qrcode like so
import 'text-encoding';
sample of how your code should look like when done with the install
import QRCode from 'react-native-qrcode-svg';
import 'text-encoding';
hope this helps!
Upvotes: 5