janoside / btc-rpc-explorer

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

Error (mixins.pug) when trying to explore a block #653

Open WCTwine opened 1 month ago

WCTwine commented 1 month ago

Describe the bug

A clear and concise description of what the bug is.

Environment (please complete the following information):

Configuration file content

Please include the content from the following files. BE SURE TO MODIFY YOUR CREDENTIALS BEFORE SUBMITTING!!!

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.

WCTwine commented 1 month ago

When I try to explore a selected Bitcoin block I get the following error message:

TypeError: /usr/local/lib/node_modules/btc-rpc-explorer/views/includes/shared-mixins.pug:227 if (!coinbaseTx && Object.keys(txInputs).length < tx.vin.length) Cannot convert undefined or null to object

To reproduce:

  1. Select "Browse blocks"
  2. Click on a block number

Environment:

WCTwine commented 1 month ago

Update: the following code fix by ChatGPT worked:

Open /usr/local/lib/node_modules/btc-rpc-explorer/views/includes/shared-mixins.pug Got to line 227 Replace line 227 code with: if (!coinbaseTx && txInputs && Object.keys(txInputs).length < tx.vin.length) Save and restart btc-rpc-explorer

After doing this fix, I am able to browse and open blocks successfully