Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
WCTwine opened this issue Jul 20, 2024 · 2 comments
Open

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

WCTwine opened this issue Jul 20, 2024 · 2 comments
Labels

Comments

@WCTwine
Copy link

WCTwine commented Jul 20, 2024

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.

@WCTwine WCTwine added the bug label Jul 20, 2024
@WCTwine
Copy link
Author

WCTwine commented Jul 20, 2024

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:

  • Bitcoin Core / Node Version v27.1.0
  • NodeJS Version v18.19.1
  • Browser: Firefox
  • Installation Method: "npm"

@WCTwine WCTwine changed the title Error (mixins.pug0 Error (mixins.pug) when trying to explore a block Jul 20, 2024
@WCTwine
Copy link
Author

WCTwine commented Jul 20, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant