-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
crypto module missing on react native app #643
Comments
Unfortunately React Native is not a supported environment for this library. Prior issues have been made that may or may not have helpful workarounds, e.g. #530 |
Another dev ran into a similar issue and wrote up his experience here: https://medium.com/@shrinerp/algosdk-vue-js-webpack-and-node-js-d10014e87a55 |
Getting this exact same issue with create-react-app as well.
|
@Blackglade you are seeing that because one of our dependencies, tweetnacl-js, uses This is at odds with your React webpack build, which thinks there must be a problem because it doesn't know about the module.exports = {
//...
resolve: {
fallback: {
crypto: false, // do not include a polyfill for crypto
},
},
}; If you are aware of any better way this issue can be solved, please let us know. |
Yup @jasonpaulos I was able to get around this fairly easily, but it's still a hassle given the fact that I'm using create-react-app which makes editing it's webpack config impossible unless I eject all the scripts. Please see my comments here: #645 |
I will try @barnjamin solution, it sounds pretty promising. I will keep you up to date. Edit Can't really use @barnjamin solution, since react native projects don't have a Update 1 Update 2
New error from the expo go app: No identifiers allowed directly after numeric literal, no stack I think I'm gonna take a break now. |
I finally got it working:
(Not sure if this is the best solution) |
I just wanted to say that I've opened #707, which should fix the error about a missing |
Subject of the issue
I'm trying to use the sdk in a react native app. Since the react native doesn't include the node standard library the following error pops up:
The package at "node_modules/algosdk/dist/browser/algosdk.min.js" attempted to import the Node standard library module "crypto".
Steps to reproduce
Is there a way to fix this?
Thank you
The text was updated successfully, but these errors were encountered: