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.



  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 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

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.

1 Like

Hello, I encountered the same issue when I start the front-end demo, I try to acces the on my laptop, and the brower showed the same error, do you know how to solve it?

@laura @berlin

1 Like

Hi @stan_yi, can you post the contents of your EngmaInit.js and getWeb3.js files, they’re under client/src/utils?

Oh nvm @stan_yi I see your problem’s been resolved with @taariq’s help! That’s awesome :smiley:

1 Like

thanks for your reply :wink:

1 Like