Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

321
Views
Failed to evaluate transaction: TypeError: Cannot read properties of undefined (reading 'toString') reactJS

frontend code reactJS:

await axios
.put("http://localhost:8080/api/updateBudget/"+gmail, bud)
.then((response) => {
  console.log(response);
})
.catch((error) => {
  if (error.response) {
    console.log(error.response);
    console.log("server responded");
  } else if (error.request) {
    console.log("network error");
  } else {
    console.log(error);
  }
});

Backend code NodeJS:

app.put('/api/updateBudget/:gmail', async function (req, res) {
    try {
    const ccpPath = path.resolve(__dirname, '..', 'dev','fabric-samples','test-network', 'organizations', 'peerOrganizations', 'org1.example.com', 'connection-org1.json');
    const ccp = JSON.parse(fs.readFileSync(ccpPath, 'utf8'));
     
    const walletPath = path.join(process.cwd(), 'wallet');
    const wallet = await Wallets.newFileSystemWallet(walletPath);
    console.log(`Wallet path: ${walletPath}`);
     
    const identity = await wallet.get('appUser');
    if (!identity) {
    console.log('An identity for the user "appUser" does not exist in the wallet');
    console.log('Run the registerUser.js application before retrying');
    return;
    }
     
    const gateway = new Gateway();
    await gateway.connect(ccp, { wallet, identity: 'appUser', discovery: { enabled: true, asLocalhost: true } });
     
    const network = await gateway.getNetwork('testchannel');
     
    const contract = network.getContract('supply_chain');
     

     
    await contract.submitTransaction('updateBudget',req.body.gmail,req.body.bud);
    console.log('Transaction has been submitted');
    res.send('Transaction has been submitted');
     
    await gateway.disconnect();
     
    } catch (error) {
    console.error(`Failed to evaluate transaction: ${error}`);
    process.exit(1);
    }
    });

i am getting network error in console and typeError in terminal whenver i hit the api. In frontend i have used ReactJS and in backend i have used NodeJS and i am storing data in blockchain.

about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!