dappuniversity / election

A Decentralized Ethereum Voting Application Tutorial
564 stars 506 forks source link

candidates wont display in chrome, getting 304 #10

Open baronson11 opened 6 years ago

baronson11 commented 6 years ago

Any help with this is appreciated. Restarting chrome doesnt help.

iridescent995 commented 6 years ago

can you tell me at what stage are you in, I was facing the same error in displaying the candidates before implementing the "votes code" so I removed all the votes related functions from app.js and it worked.

P.S: try to inspect element in chrome and see what error you are getting.

Hope this helps!

dyttokaa commented 5 years ago

@iridescent995 hey there! I have the same problem... migration stage was passed successfully but app doesnt work after launching (npm run dev):

Screenshot 2019-06-24 at 01 43 19
bongi23 commented 5 years ago

Check my comment here...for me it solved, hope it helps!

DarrenMa commented 5 years ago

try this:

initWeb3: function () {
    // TODO: refactor conditional
    if (typeof web3 !== 'undefined') {
      // If a web3 instance is already provided by Meta Mask.
      App.web3Provider = web3.currentProvider;
      ethereum.enable();
      web3 = new Web3(web3.currentProvider);
    } else {
      // Specify default instance if no web3 instance provided
      App.web3Provider = new Web3.providers.HttpProvider('http://localhost:7545');
      ethereum.enable();
      web3 = new Web3(App.web3Provider);
    }
    return App.initContract();
  }
cryptowuki commented 4 years ago

The candidates were not displayed. I commented off the content.hide() statement in the render function() as shown below:

render: function() { var electionInstance; var loader = $("#loader"); var content = $("#content");

loader.show();
//content.hide();

// Load account data
web3.eth.getCoinbase(function(err, account) {
  if (err === null) {
    App.account = account;
    $("#accountAddress").html("Your Account: " + account);
  }
});