fix(clerk-expo): Use atob polyfill by default
Description
Use a polyfill for the atob function to prevent errors when using Expo Go 51, since the default engine's implementation is stricter than it should be and errors when the publishable key's base64 encoded part's length is not divisible by 4.
Related issue by the default JS engine for expo 51: https://github.com/facebook/hermes/issues/1379
Checklist
- [ ]
npm testruns as expected. - [ ]
npm run buildruns as expected. - [ ] (If applicable) JSDoc comments have been added or updated for any package exports
- [ ] (If applicable) Documentation has been updated
Type of change
- [x] 🐛 Bug fix
- [ ] 🌟 New feature
- [ ] 🔨 Breaking change
- [ ] 📖 Refactoring / dependency upgrade / documentation
- [ ] other:
🦋 Changeset detected
Latest commit: 7e206ff3656560e724bb475b53c4dadb8c0500c8
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
| Name | Type |
|---|---|
| @clerk/clerk-expo | Patch |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Can we detect the expo version used and polyfil for >51?
Opted in checking for hermes and only applying the polyfill in that case. https://reactnative.dev/docs/hermes#confirming-hermes-is-in-use
Just adding a comment to say that I got this error when using "@clerk/clerk-expo": "^1.0.7", in Expo 51.
ERROR Error: Not a valid base64 encoded string length
This error is located at:
in ClerkProvider (created by RootLayout)
This PR seems to have solved my issue. Thanks!
!snapshot
Hey @desiprisg - the snapshot version command generated the following package versions:
| Package | Version |
|---|---|
| @clerk/clerk-expo | 1.0.8-snapshot.v7e206ff |
| gatsby-plugin-clerk | 5.0.0-beta.45 |
Tip: Use the snippet copy button below to quickly install the required packages.
@clerk/clerk-expo
npm i @clerk/[email protected] --save-exact
gatsby-plugin-clerk
npm i [email protected] --save-exact