Using expo react-native and realm-web for iOS etc
ReferenceError: Can't find variable: TextDecoder
Install dependencies
expo install text-encoding big-integer
Create polyfill file at polyfills/TextEncoding.js
import TextEncodingPolyfill from 'text-encoding';
import BigInt from 'big-integer';
Object.assign(global, {
TextEncoder: TextEncodingPolyfill.TextEncoder,
TextDecoder: TextEncodingPolyfill.TextDecoder,
BigInt: BigInt,
});
Update index.js
(if you have one) or App.js
with the following at the top
import "./polyfills/TextEncoding";
Note: Using Babel for polyfills means you have to eject. So do this instead.
Restart expo using expo start -c -i
iOS should now boot.