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

Invalid argument: undefined #454

Closed junjie9021 closed 1 year ago

junjie9021 commented 2 years ago

Error: /workspace/views/includes/index-network-summary.pug:177 175| 176| else

177| - var estimatedSupply = utils.estimatedSupply(getblockchaininfo.blocks); 178| 179| span #{parseInt(estimatedSupply).toLocaleString()} 180| span.text-tiny.ms-2.text-muted

[DecimalError] Invalid argument: undefined at new Decimal (/workspace/node_modules/decimal.js/decimal.js:4373:15) at Decimal.P.times.P.mul (/workspace/node_modules/decimal.js/decimal.js:1878:17) at Object.estimatedSupply (/workspace/app/utils.js:647:48) at block (eval at wrap (/workspace/node_modules/pug-runtime/wrap.js:6:10), :6231:29) at Object.pug_interp (eval at wrap (/workspace/node_modules/pug-runtime/wrap.js:6:10), :255:10) at block (eval at wrap (/workspace/node_modules/pug-runtime/wrap.js:6:10), :6206:27) at Object.pug_interp (eval at wrap (/workspace/node_modules/pug-runtime/wrap.js:6:10), :195:10) at block (eval at wrap (/workspace/node_modules/pug-runtime/wrap.js:6:10), :6019:26) at Object.pug_interp (eval at wrap (/workspace/node_modules/pug-runtime/wrap.js:6:10), :166:10) at eval (eval at wrap (/workspace/node_modules/pug-runtime/wrap.js:6:10), :6016:30) at template (eval at wrap (/workspace/node_modules/pug-runtime/wrap.js:6:10), :9543:7) at Object.exports.renderFile (/workspace/node_modules/pug/lib/index.js:454:38) at Object.exports.renderFile (/workspace/node_modules/pug/lib/index.js:444:21) at exports.__express (/workspace/node_modules/pug/lib/index.js:493:11) at View.engine (/workspace/app.js:175:23) at View.render (/workspace/node_modules/express/lib/view.js:135:8)

jsarenik commented 2 years ago

How do you run it and what system do you run it on?

All those questions in the issue template actually make sense so please answer them.

And for proper (monospace/code) quoting please see this: https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#code-and-syntax-highlighting

**Describe the bug**

A clear and concise description of what the bug is.

**Environment (please complete the following information):**

 - Bitcoin Core / Node Version [e.g. 0.16.3]
 - NodeJS Version [e.g. 9.x]
 - Browser [e.g. chrome, safari]
 - Code Version / Commit [e.g. ab6cde8]
 - Installation Method [e.g. "npm" or "source code"]

**Configuration file content**

Please include the content from the following files. **BE SURE TO MODIFY YOUR CREDENTIALS BEFORE SUBMITTING!!!**
 - bitcoin.conf
 - Your btc-rpc-explorer environment configuration (either `$WORKING_DIR/.env` or `~/.config/btc-rpc-explorer.env`)

**To Reproduce**

Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Screenshots or Log Output**

If applicable, add screenshots or log output to help explain your problem.

**Additional context**

Add any other context about the problem here.
junjie9021 commented 2 years ago

soryy, I didn't add a description

os: ubuntu 20.04 btc-rpc-explorer commit: d96ded6e0d294f0c6e1328ebf97a3136e7d63814 run command:

docker build 
docker run 

.env profile

BTCEXP_BITCOIND_URI=bitcoin://test:test@172.17.0.1:18443?timeout=10000

my running regtest bitcore node, verison 23.0. After starting the browser, the following exception occurs during access

/workspace/views/includes/index-network-summary.pug:177 175| 176| else > 177| - var estimatedSupply = utils.estimatedSupply(getblockchaininfo.blocks); 178| 179| span #{parseInt(estimatedSupply).toLocaleString()} 180| span.text-tiny.ms-2.text-muted [DecimalError] Invalid argument: undefined
jsarenik commented 2 years ago

@janoside Please have a look.

tsp187 commented 2 years ago

Do it

janoside commented 1 year ago

Cleaning up old issues. If you're still having this problem using the latest code (3.4-beta or greater), feel free to reply.