js-jose
js-jose copied to clipboard
Can't find variable: atob (Jose.min.js) for React Native Project

You will need a atob polyfill
Does the following help? In some environments (e.g. node), atob/btoa don't exist but you can use Buffer.
function btoa(data) { return new Buffer(data, "binary").toString("base64"); }
function atob(data) { return new Buffer(data, "base64").toString("binary"); }
I have faced this issue and I have not solutions.
@MrLich does the above snippet now work for you? You just need to have btoa
and atob
functions be defined in the global scope.
@MrLich does the above snippet now work for you? You just need to have
btoa
andatob
functions be defined in the global scope.
Thanks, I have solved it by adding more code .
@MrLich how did you solve? thanks
I had the same problem. I solved it by requiring this polyfill in my project
I had the same problem and found online the below that I added to my App.js file. It works for me
import {decode, encode} from 'base-64' if (!global.btoa) { global.btoa = encode } if (!global.atob) { global.atob = decode }
I had the same problem and found online the below that I added to my App.js file. It works for me
import {decode, encode} from 'base-64' if (!global.btoa) { global.btoa = encode } if (!global.atob) { global.atob = decode }
it is not working for me
I had the same problem and found online the below that I added to my App.js file. It works for me import {decode, encode} from 'base-64' if (!global.btoa) { global.btoa = encode } if (!global.atob) { global.atob = decode }
it is not working for me
Installing the base-64 npm package and then adding the import code above to App.js file solved my issue.
Installing the base-64 npm package and then adding the import code above to App.js file solved my issue.
This solved my problem too!
https://www.npmjs.com/package/@react-native-anywhere/polyfill-base64. helped me. Дапамагло мне