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.
3 Answers 3
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!
Comments
They have fixed this issue with version 6.3.2
Update to this version and everything should work fine.
Ref:
Comments
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'
3 Comments
Explore related questions
See similar questions with these tags.
qr-code-svgfrom loading using Metro's blocklist if you can't remove it.