Polygon-Academy / basicnfts

Basic smart contract + frontend for deploying NFTs on Polygon
MIT License
23 stars 20 forks source link

Failed to get chainId when deploying #3

Open ariesgun opened 2 years ago

ariesgun commented 2 years ago

I got an issue when running yarn deploy

$ yarn workspace @scaffold-eth/hardhat deploy --network mumbai
$ hardhat deploy --export-all ../react-app/src/contracts/hardhat_contracts.json --network mumbai
Nothing to compile
failed to get chainId, falling back on net_version...
Error HH110: Invalid JSON-RPC response received: <!DOCTYPE html>
<html lang="en-US">
   <head>
      <title>Access denied</title>
      <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
      <meta name="robots" content="noindex, nofollow" />
      <meta name="viewport" content="width=device-width,initial-scale=1" />
      <link rel="stylesheet" href="/cdn-cgi/styles/errors.new.min.css" media="screen" />
      <script>
(function(){if(document.addEventListener&&window.XMLHttpRequest&&JSON&&JSON.stringify){var e=function(a){var c=document.getElementById("error-feedback-survey"),d=document.getElementById("error-feedback-success"),b=new XMLHttpRequest;a={event:"feedback clicked",properties:{errorCode:1020,helpful:a,version:3}};b.open("POST","https://sparrow.cloudflare.com/api/v1/event");b.setRequestHeader("Content-Type","application/json");b.setRequestHeader("Sparrow-Source-Key","c771f0e4b54944bebf4261d44bd79a1e");
b.send(JSON.stringify(a));c.classList.add("feedback-hidden");d.classList.remove("feedback-hidden")};document.addEventListener("DOMContentLoaded",function(){var a=document.getElementById("error-feedback"),c=document.getElementById("feedback-button-yes"),d=document.getElementById("feedback-button-no");"classList"in a&&(a.classList.remove("feedback-hidden"),c.addEventListener("click",function(){e(!0)}),d.addEventListener("click",function(){e(!1)}))})}})();   
</script>

      <script>
         (function(){if(document.addEventListener){var c=function(){var b=document.getElementById("copy-label");document.getElementById("plain-ray-id");if(navigator.clipboard)navigator.clipboard.writeText("71a29baaba7bb87e");else{var a=document.createElement("textarea");a.value="71a29baaba7bb87e";a.style.top="0";a.style.left="0";a.style.position="fixed";document.body.appendChild(a);a.focus();a.select();document.execCommand("copy");document.body.removeChild(a)}b.innerText="Copied"};document.addEventListener("DOMContentLoaded",
function(){var b=document.getElementById("plain-ray-id"),a=document.getElementById("click-to-copy-btn");"classList"in b&&(b.classList.add("hidden"),a.classList.remove("hidden"),a.addEventListener("click",c))})}})();
      </script>
      <script defer src="https://api.radar.cloudflare.com/beacon.js"></script>
   </head>

   <body>
      <div class="main-wrapper" role="main">
         <div class="header section">
            <h1>
               <span class="error-description">Access denied</span>
               <span class="code-label">Error code <span>1020</span></span>
            </h1>
            <div class="large-font">
               <p>You do not have access to rpc-mumbai.maticvigil.com.</p><p>The site owner may have set restrictions that prevent you from accessing the site. Contact the site owner for access or try loading the page again.</p>  
            </div>
         </div>
      </div>

      <div>
         <div class="clearfix section">
            <div class="column know-more">
               <h2 class="large-font">Additional information</h2>
               <p>The access policies of a site define which visits are allowed. Your current visit is not allowed 
according to those policies.</p><p>Only the site owner can change site access policies.</p>
            </div>
            <div class="column know-more">
               <h2 class="large-font">I am the site owner</h2>
               <p class="ray-id-wrapper">
                  Ray ID:
                  <span class="plain-ray-id" id="plain-ray-id">
                     71a29baaba7bb87e
                  </span>
                  <button class="click-to-copy-btn hidden" id="click-to-copy-btn" title="Click to copy Ray ID" type="button">
                     <span class="ray-id">71a29baaba7bb87e</span><span class="copy-label" id="copy-label">Copy</span>
                  </button>
               </p>
               <ol>
                  <li>
                     Search the
                     <a rel="noopener noreferrer" href="https://dash.cloudflare.com/?to=/:account/:zone/firewall" target="_blank">Firewall Events Log</a>
                     <img class="external-link" title="Opens in new tab" src="/cdn-cgi/images/external.png" alt="External link">
                     for the above Ray ID.
                  </li>
                  <li>Examine and assess the details of the access policy.</li>
               </ol>
               <br>
               <a rel="noopener noreferrer" href="https://support.cloudflare.com/hc/articles/360029779472-Troubleshooting-Cloudflare-1XXX-errors#error1020" target="_blank">Troubleshooting guide</a>
               <img class="external-link" title="Opens in new tab" src="/cdn-cgi/images/external.png" alt="External link">
            </div>
         </div>

         <div class="clearfix footer section" role="contentinfo">
            <div class="column">
               <div class="feedback-hidden py-8 text-center" id="error-feedback">
    <div id="error-feedback-survey" class="footer-line-wrapper">
        Was this page helpful?
        <button class="border border-solid bg-white cf-button cursor-pointer ml-4 px-4 py-2 rounded" id="feedback-button-yes" type="button">Yes</button>
        <button class="border border-solid bg-white cf-button cursor-pointer ml-4 px-4 py-2 rounded" id="feedback-button-no" type="button">No</button>
    </div>
    <div class="feedback-success feedback-hidden" id="error-feedback-success">
        Thank you for your feedback!
    </div>
</div>

            </div>
            <div class="column footer-line-wrapper text-center">
               Performance &amp; security by <a rel="noopener noreferrer" href="https://www.cloudflare.com" target="_blank">Cloudflare</a>
               <img class="external-link" title="Opens in new tab" src="/cdn-cgi/images/external.png" alt="External link">
            </div>
         </div>
      </div>
   </body>
</html>

For more info go to https://hardhat.org/HH110 or run Hardhat with --show-stack-traces
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed.
Exit code: 1
albatros-github commented 2 years ago

same issue. any solution? have you try changing rpc node url/provider?