margelo / react-native-quick-crypto

⚡️ A fast implementation of Node's `crypto` module written in C/C++ JSI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Expo Device Not working - Simulator ok

aorfevre opened this issue · comments

commented

Hello,

I am trying to have ⚡️ react-native-quick-crypto working with my expo device but I keep on getting the following error :
ERROR Error: react-native-quick-crypto is not supported in Expo Go! Use EAS (expo prebuild) or eject to a bare workflow instead.

I really don't want to eject to bare workflow.
Is the only solution to use EAS ?

My dependencies :
"dependencies": {
"@ethersproject/shims": "^5.7.0",
"assert": "^2.0.0",
"axios": "^1.4.0",
"crypto-browserify": "^3.12.0", <---- I have tested that one instead of react-native-quick-crypto and it works but I would prefer to use your packagE.

"ethers": "5.7",
"expo": "~48.0.18",
"expo-constants": "^14.2.1",
"expo-dev-client": "~2.2.1",
"expo-linking": "^4.0.1",
"expo-secure-store": "~12.1.1",
"expo-splash-screen": "~0.18.2",
"expo-status-bar": "~1.4.4",
"expo-web-browser": "^12.1.1",
"react": "18.2.0",
"react-native": "0.71.8",
"react-native-quick-crypto": "^0.6.1"

},
"devDependencies": {
"@babel/core": "^7.20.0",
"buffer": "^6.0.3",
"expo-crypto-polyfills": "^1.1.0",
"readable-stream": "^4.4.0"
},

I have a metro config like that :
image

I also would prefer not to use any of the rn-nodeify hack to inject Crypto node module.

How shall I move forward ?

You can use an expo development build which allows you to use native packages while still using managed expo. You basically create your own build of expo go with the native libraries you need automatically bundled inside. Have a look at the docs

it seems like you found a solution, thanks for reporting :)