1.3.8 won't work with expo anymore

1.3.7 worked with expo, but 1.3.8 doesn't, and gives this error:
iOS Bundling failed 7588ms node_modules/expo-router/entry.js (1661 modules)
The package at "node_modules/jose/dist/node/esm/runtime/decrypt.js" attempted to import the Node standard library module "node:crypto".
It failed because the native React runtime does not include the Node standard library.
iOS Bundling failed 7588ms node_modules/expo-router/entry.js (1661 modules)
The package at "node_modules/jose/dist/node/esm/runtime/decrypt.js" attempted to import the Node standard library module "node:crypto".
It failed because the native React runtime does not include the Node standard library.
32 Replies
SKetU
SKetU5w ago
same here, now only 1.3.6 works
Ping
Ping4w ago
Hey guys, can you try 1.3.9?
SKetU
SKetU4w ago
Thanks for the update, yes the original issue seems like it's fixed now but now I am getting a new type error TypeError: Cannot read property 'subtle' of undefined, js engine: hermes This might be unrelated but only adding one extra crypto polyfils fixed it I will drop that here soon
import * as ExpoeCrypto from 'expo-crypto';

if (typeof global.crypto === 'undefined') {
global.crypto = {};
}

global.crypto.getRandomValues = ExpoeCrypto.getRandomValues;
global.crypto.randomUUID = ExpoeCrypto.randomUUID;

if (typeof globalThis !== 'undefined') {
globalThis.crypto = global.crypto;
}
import * as ExpoeCrypto from 'expo-crypto';

if (typeof global.crypto === 'undefined') {
global.crypto = {};
}

global.crypto.getRandomValues = ExpoeCrypto.getRandomValues;
global.crypto.randomUUID = ExpoeCrypto.randomUUID;

if (typeof globalThis !== 'undefined') {
globalThis.crypto = global.crypto;
}
Suri
Suri4w ago
I have tried this, but no help
SKetU
SKetU4w ago
add this then import in your layout
edwardrenton
edwardrenton4w ago
Also tried this and doesn't help
SKetU
SKetU4w ago
how did you add ?
Aswin
Aswin4w ago
Do you put this in polyfills.js?
SKetU
SKetU4w ago
Yes you would add a new file in your project root and import it in your layout
Aswin
Aswin4w ago
It seems like even that doesn't fix the "subtle" message error. The only thing that fixes it for me is if i comment out the phone number plugin initialization in authClient (expo app side).
SKetU
SKetU4w ago
What unstable error are you talking about!? This was the error I tried to fix
Aswin
Aswin4w ago
haha sorry i meant subtle
Alex Yang
Alex Yang4w ago
can you show the full error log?
SKetU
SKetU4w ago
ERROR TypeError: Cannot read property 'subtle' of undefined, js engine: hermes
ERROR Warning: Invalid prop `style` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.

Call Stack
DefaultNavigator(expo-router/build/views/Navigator.js) (<anonymous>)
RNCSafeAreaProvider (<anonymous>)
App (<anonymous>)
ErrorOverlay (<anonymous>)
ERROR TypeError: Cannot read property 'subtle' of undefined, js engine: hermes
ERROR Warning: Invalid prop `style` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.

Call Stack
DefaultNavigator(expo-router/build/views/Navigator.js) (<anonymous>)
RNCSafeAreaProvider (<anonymous>)
App (<anonymous>)
ErrorOverlay (<anonymous>)
this is what happens when I don't use custom crypto polyfill
Alex Yang
Alex Yang4w ago
GitHub
React Native build issue on v1.3.8 · Issue #4471 · better-auth/be...
Is this suited for github? Yes, this is suited for github To Reproduce Create a new expo app, install better-auth@1.3.8 and @better-auth/expo@1.3.8, setup according to docs, import a plugin from be...
Alex Yang
Alex Yang4w ago
can you try this?
SKetU
SKetU4w ago
I forgot to mention, yes react-native-webcrypto was the perfect solution it's just being too old I couldn't compile the devclient of expo itself and this is working perfectly for my usecase
bekacru
bekacru4w ago
was the react-native-webcrypto requried before 1.3.7?
SKetU
SKetU4w ago
Nope only after 1.3.6 still working normally without anything
Alex Yang
Alex Yang4w ago
so 1.3.7 is broken right? Hi I just tried few times can you add expo-web-browser in app.config.ts plugins?
SKetU
SKetU4w ago
I did but still those errors are same I tried new 1.3.10 beta 4 but still no luck
Alex Yang
Alex Yang4w ago
try to cleanup the node_modules?
Suri
Suri4w ago
This worked for me... But now I'm not able to load nativewind styles. Does anyone has this issue?
SKetU
SKetU4w ago
Updated to sdk 54? Did but still without polyfils 1 3.10 beta 4 is the same as 1.3.9
Alex Yang
Alex Yang4w ago
are you using pg?
SKetU
SKetU4w ago
postgres? no powersync mysql in client side but on server side yes
Alex Yang
Alex Yang4w ago
hi, can you try 1.3.10-beta.7 I think we defnitely remove the incompatable code
SKetU
SKetU4w ago
yes, it works now without any issue thanks man
Alex Yang
Alex Yang3w ago
1.3.10 is released
SKetU
SKetU3w ago
it's all good now, thanks
HoshangDEV
HoshangDEV3w ago
btw, it works on iOS production build ✅
Alex Yang
Alex Yang2w ago
awesome!

Did you find this page helpful?