Invalid hexlify value

Hi team,

I followed the tutorials of how to create a simple counter contract and frontend for it.

Everything appears to compile, the contract deployed just fine too. I generated the types in frontend/src/contracts using:

npx fuels typegen -i ../counter-contract/out/debug/*-abi.json -o ./src/contracts

and when I start the React app using npm start it starts up without any errors but then in the browser I see:

invalid hexlify value (argument="value", value="0x...", code=INVALID_ARGUMENT, version=bytes/5.7.0)
    at Logger.makeError (http://localhost:3000/static/js/bundle.js:1329:19)
    at Logger.throwError (http://localhost:3000/static/js/bundle.js:1338:16)
    at Logger.throwArgumentError (http://localhost:3000/static/js/bundle.js:1341:17)
    at hexlify (http://localhost:3000/static/js/bundle.js:869:17)
    at toBech32 (http://localhost:3000/static/js/bundle.js:56608:261)
    at Address.fromB256 (http://localhost:3000/static/js/bundle.js:56769:24)
    at Address.fromString (http://localhost:3000/static/js/bundle.js:56786:60)
    at Address.fromAddressOrString (http://localhost:3000/static/js/bundle.js:56794:47)
    at new Contract (http://localhost:3000/static/js/bundle.js:60157:69)
    at CounterContractAbi__factory.connect (http://localhost:3000/static/js/bundle.js:257:12)

Is it possible that the Fuel wallet I have installed in my Chrome browser is conflicting with my MetaMask one? Any other suggestions what might be wrong?


Oops, I should have read the guide more carefully. In case someone else hits this read this part of the frontend quick start guide:

Finally, replace the value of the CONTRACT_ID variable at the top of your App.tsx file with the address of the contract you just deployed.

After I replaced this value with what I got during the deployment it worked just fine. Sorry for the spam :slight_smile:


Glad you resolved it! :slightly_smiling_face: And thankyou for posting the fix for future readers.


This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.