I am kinda new to Ethereum and Web3 so I am trying to implement the Ethereum: Building Blockchain Decentralized Apps (DApps) tutorial. I have already installed web3 and web3-utils.

npm view web3 version

My code is :

<script src="web3.min.js"></script>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>      
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>

//checking   the version of web3
  if ((typeof window.ethereum !== 'undefined') || (typeof window.web3 !== 'undefined')){
      web3 = new Web3(web3.currentProvider);
  } else{
    web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
  var version = web3.version.api;
  console.log("Using web3 version: " + version);

//Form function
    var fromAddress = $('#fromAddress').val();

    //checking if the address of the uploader's is valid
    if(web3.utils.isAddress(fromAddress) != true) {
      alert('You did not enter a valid ethereum address.');

I get the error

TypeError: web3.utils is undefined[Learn More

I actually upgraded my web3 version to 1.0.0 in case this question's solution worked in my problem but nothing changed. Any help would be valuable , thanks.

1 Answer 1


It may be problem with your web3.js file. Try replacing

<script src="web3.min.js"></script>


<script src="https://cdn.jsdelivr.net/gh/ethereum/[email protected]/dist/web3.min.js"></script>
  • Happy to hear this from you Mar 15, 2019 at 18:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.