title: I'm getting a gas limit error when calling ethers web3js on a view/ read-only blockchain function
body: <p>Uncaught (in promise) Error: cannot estimate gas; transaction may fail or may require manual gas limit (error={&quot;code&quot;:-32000,&quot;message&quot;:&quot;execution reverted&quot;}, method=&quot;call&quot; code=UNPREDICTABLE_GAS_LIMIT) error.</p>
  <p>I am definitely calling a read-only function. The function is this:</p>
  <pre><code>function vaultSize(uint256 vaultId) public view virtual returns (uint256) {
      return
          store.isD2Vault(vaultId)
              ? store.d2Holdings(vaultId)
              : store.holdingsLength(vaultId).add(
                  store.reservesLength(vaultId)
              );
  }
  </code></pre>
  <p>If that matters. I don't understand why this gas limit error is even happening or how to fix it and I feel like debugging is so hard when it's not my own contract because the revert reason is never obvious.</p>
  <p>Here's how I'm calling it in javascript.</p>
  <pre><code>await contract.vaultSize(0)
  </code></pre>
  <p>I don't see why this is happening. This is public code in a contract that is obviously working with thousands of transactions a day.</p>
  <p>The address is &quot;0xdaa17a5f60E94d5f97968aa1E790c164e65c97Be&quot;</p>