I have looked at other threads which are about the same error, but none of them seemed to be helpful in my case.
I have a react app, it is a fork of this code: https://github.com/stellar/laboratory.
The change I am trying to make is I am adding another library from which I will be eventually calling some functions.
The errors are originating from the reducers file I added, below is the portion I added into it. The errors are related to the bcoin library and the create_wallet function.
var id, passphrase, witness, watchOnly, accountKey;
witness = false;
watchOnly = false;
var {WalletClient} = require('../../bcoin/bclient.js');
var {Network} = require('../../bcoin/bcoin.js');
var network = Network.get('regtest');
var walletOptions = {
network: network.type,
port: network.walletPort,
apiKey: 'api-key'
}
var walletClient = new WalletClient(walletOptions);
var options;
function operations(state = defaultOperations, action) {
let targetOpIndex, newOps;
switch (action.type) {
case LOAD_STATE:
if (action.slug === SLUG.UTXOTX) {
return defaultOperations;
}
break;
case 'ADD_OPERATION':
return Array.prototype.concat(state, {
id: action.opId,
name: '',
attributes: {},
});
case 'CREATE_WALLET':
options = {
passphrase: action.newAttributes.passphrase,
witness: witness,
watchOnly: watchOnly,
accountKey: action.newAttributes.accountKey
};
id = action.newAttributes.walletId;
(async() => {
const result = await walletClient.createWallet(id, options);
console.log(result);
})();
When I try to run the app, there are no errors on the terminal, however nothing shows up on the UI. And in the developer console, an error shows up which says, "RegeneratorRuntine is not defined". And I am not using webpack or babel, even though they are added in the package.json file.
If more information is required, feel free to ask.