janoside / btc-rpc-explorer

Database-free, self-hosted Bitcoin explorer, via RPC to Bitcoin Core.
https://bitcoinexplorer.org
MIT License
1.5k stars 1.11k forks source link

mining-summary: totalSubsidy: Cannot read properties of undefined #442

Closed jsarenik closed 2 years ago

jsarenik commented 2 years ago

Describe the bug

When I open https://bitcoinexplorer.org/mining-summary I see following error in the Google Chrome browser console:

Uncaught TypeError: Cannot read properties of undefined (reading 'totalSubsidy')
    at displaySummaryData (mining-summary:137:57)
    at Object.<anonymous> (mining-summary:97:5)
    at c (jquery.min.js:2:28327)
    at Object.fireWith [as resolveWith] (jquery.min.js:2:29072)
    at l (jquery.min.js:2:79901)
    at XMLHttpRequest.<anonymous> (jquery.min.js:2:82355)

Environment (please complete the following information):

Configuration file content

All seen on production bitcoinexplorer.org

To Reproduce

Steps to reproduce the behavior:

  1. Go to https://bitcoinexplorer.org/mining-summary
  2. Open developer console.
  3. See the error
janoside commented 2 years ago

@jsarenik I'm not able to reproduce this right now. Are you still seeing this? When you see this error, I assume it also prevents the UI from loading, correct?

jsarenik commented 2 years ago

No other issues. Web site (UI) loads fine, just the error shows in the console. Also in an incognito window with no extensions.

The error shows only after the site is fully rendered and loading of block information is finished.

Both at https://bitcoinexplorer.org/mining-summary and https://be.anyone.eu.org/mining-summary.

janoside commented 2 years ago

Thanks for the additional info. I think I have a handle on this now. There's a race condition between frontend/backend. 2 requests are being made to get the mining summary data after it's done processing - the first request is getting the data and the second request is just being given nothing. Fix incoming...