Example React App issue

Has anyone experienced the problem with example React App?
this problem came from running the demo app from the blog.

Unhandled Rejection (Error): Given action “ENIGMA_INITIALIZED”, reducer “enigma” returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.

:arrow_forward: 3 stack frames were collapsed.

App._callee$

src/components/App.js:38

  35 | // Initialize enigma-js client library (including web3)  36 | const enigma = await getEnigmaInit();  37 | // Create redux action to initialize set state variable containing enigma-js client library> 38 | this.props.initializeEnigma(enigma);     | ^  39 | // Initialize unlocked accounts  40 | const accounts = await enigma.web3.eth.getAccounts();  41 | // Create redux action to initialize set state variable containing unlocked accounts

resolved. need to change the hardcoded localhost and 127.0.0.1 local host address for connecting to enigma in get EngmaInit.js and getWeb3.js if deployed to remote machines.

However, there is “not enough tokens” problem after submitting 3 addresses.

demo-app.rebloc.io/:1 Uncaught (in promise) {name: “NotEnoughTokens”, message: “Not enough tokens to pay the fee”}message: "Not enough tokens to pay the fee"name: "NotEnoughTokens"proto: Object
Promise.then (async)
Form._this.listenToSubmit @ createReduxForm.js:299
(anonymous) @ createReduxForm.js:328
(anonymous) @ silenceEvents.js:9
callCallback @ react-dom.development.js:147
invokeGuardedCallbackDev @ react-dom.development.js:196
invokeGuardedCallback @ react-dom.development.js:250
i

1 Like

@berlin I’ve seen that error before. Try modifying the gas limit and gax tx values to:

const taskGasLimit = 10000000;
const taskGasPx = utils.toGrains(1e-7);

Those values are used in this blog post on creating a dApp front-end using react: https://blog.enigma.co/getting-started-with-enigma-a-front-end-demo-for-dapps-bc694d3d81b9.