Description
I'm trying to create Dash Wallet App with React Native but I'm getting following error
Error: Unable to resolve module fs from /Users/kryptomind/Desktop/Development/RN-Projects/DashWalletMobileApps-KM/node_modules/bls-signatures/blsjs.js: fs could not be found within the project or in these directories:
node_modules
The only thing seems to causing error is "fs" module which is not supported in react-native.
Expected Behavior
It's not working correctly while generating mnemonic.
Current Behavior
Getting following error
Error: Unable to resolve module fs from /Users/kryptomind/Desktop/Development/RN-Projects/DashWalletMobileApps-KM/node_modules/bls-signatures/blsjs.js: fs could not be found within the project or in these directories:
node_modules
Possible Solution
Steps to Reproduce (for bugs)
- Create a react-native project ( npx react-native init AwesomeTSProject --template react-native-template-typescript )
- Install rn-nodefy in react-native project and hack the Node so you can use node core module ( https://www.npmjs.com/package/rn-nodeify )
- npm install dash
- Generate Mnemonic using following code
import Dash from 'dash';
const client = new Dash.Client({
network: 'testnet',
wallet: {
mnemonic: null,
},
});
const mnemonic = client.wallet?.exportWallet();
Context
I'm not able to use dash sdk since It was the main ingredient to create dash wallet and add functionalities like send/receive and get transactions.
Your Environment
- Version used: 3.21.2
- Environment name and version (e.g. Chrome 39, node.js 5.4): Node : v14.18.1, React-Native: 0.66.1
- Operating System and version (desktop, server, or mobile): Android/IOS