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

Error building page: TypeError: Promise.allSettled is not a function #424

Closed emanhu closed 2 years ago

emanhu commented 2 years ago

Hi, I have installed BTC-RPC-Explorer on Ubuntu, install electrumx and synced it ( I checked it with Sparrow Wallet and it work fine) Have installed my bitcoin node with TXindex=1

Added the demo config .env file and changed for my RPC and electrumx service.

when I open my browser I get the following message Error building page: TypeError: Promise.allSettled is not a function on the page

And in the terminal this:

tcexp:error Error 238023hw87gddd: TypeError: Promise.allSettled is not a function, json: {}, userData: [object Object] (json: {}) +0ms btcexp:errorVerbose Stack: TypeError: Promise.allSettled is not a function btcexp:errorVerbose at Object.awaitPromises (/usr/local/lib/node_modules/btc-rpc-explorer/app/utils.js:1291:39) btcexp:errorVerbose at router.get.asyncHandler (/usr/local/lib/node_modules/btc-rpc-explorer/routes/baseRouter.js:213:15) btcexp:errorVerbose at process._tickCallback (internal/process/next_tick.js:68:7) +0ms btcexp:error Error ExpressUncaughtError: TypeError: Promise.allSettled is not a function, json: {}, userData: [object Object] (json: {}) +3s btcexp:errorVerbose Stack: TypeError: Promise.allSettled is not a function btcexp:errorVerbose at Object.awaitPromises (/usr/local/lib/node_modules/btc-rpc-explorer/app/utils.js:1291:39) btcexp:errorVerbose at router.get.asyncHandler (/usr/local/lib/node_modules/btc-rpc-explorer/routes/snippetRouter.js:69:14) btcexp:errorVerbose at asyncUtilWrap (/usr/local/lib/node_modules/btc-rpc-explorer/node_modules/express-async-handler/index.js:3:20) btcexp:errorVerbose at Layer.handle [as handle_request] (/usr/local/lib/node_modules/btc-rpc-explorer/node_modules/express/lib/router/layer.js:95:5) btcexp:errorVerbose at next (/usr/local/lib/node_modules/btc-rpc-explorer/node_modules/express/lib/router/route.js:137:13) btcexp:errorVerbose at Route.dispatch (/usr/local/lib/node_modules/btc-rpc-explorer/node_modules/express/lib/router/route.js:112:3) btcexp:errorVerbose at Layer.handle [as handle_request] (/usr/local/lib/node_modules/btc-rpc-explorer/node_modules/express/lib/router/layer.js:95:5) btcexp:errorVerbose at /usr/local/lib/node_modules/btc-rpc-explorer/node_modules/express/lib/router/index.js:281:22 btcexp:errorVerbose at Function.process_params (/usr/local/lib/node_modules/btc-rpc-explorer/node_modules/express/lib/router/index.js:335:12) btcexp:errorVerbose at next (/usr/local/lib/node_modules/btc-rpc-explorer/node_modules/express/lib/router/index.js:275:10) btcexp:errorVerbose at Function.handle (/usr/local/lib/node_modules/btc-rpc-explorer/node_modules/express/lib/router/index.js:174:3) btcexp:errorVerbose at router (/usr/local/lib/node_modules/btc-rpc-explorer/node_modules/express/lib/router/index.js:47:12) btcexp:errorVerbose at Layer.handle [as handle_request] (/usr/local/lib/node_modules/btc-rpc-explorer/node_modules/express/lib/router/layer.js:95:5) btcexp:errorVerbose at trim_prefix (/usr/local/lib/node_modules/btc-rpc-explorer/node_modules/express/lib/router/index.js:317:13) btcexp:errorVerbose at /usr/local/lib/node_modules/btc-rpc-explorer/node_modules/express/lib/router/index.js:284:7 btcexp:errorVerbose at Function.process_params (/usr/local/lib/node_modules/btc-rpc-explorer/node_modules/express/lib/router/index.js:335:12) +3s btcexp:error Error 238023hw87gddd: TypeError: Promise.allSettled is not a function, json: {}, userData: [object Object] (json: {}) +510ms btcexp:errorVerbose Stack: TypeError: Promise.allSettled is not a function btcexp:errorVerbose at Object.awaitPromises (/usr/local/lib/node_modules/btc-rpc-explorer/app/utils.js:1291:39) btcexp:errorVerbose at router.get.asyncHandler (/usr/local/lib/node_modules/btc-rpc-explorer/routes/baseRouter.js:213:15) +510ms

The page is not loading completely and when I try to do a search for an address or block I get

age Errors Error #1

{ "errorId": "32974hrbfbvc", "error": {}, "userData": { "errorMsg": "Promise.allSettled is not a function" } }

Stacktrace

TypeError: Promise.allSettled is not a function at Object.awaitPromises (/usr/local/lib/node_modules/btc-rpc-explorer/app/utils.js:1291:39) at router.get.asyncHandler (/usr/local/lib/node_modules/btc-rpc-explorer/routes/baseRouter.js:629:15) at process._tickCallback (internal/process/next_tick.js:68:7)

(No blocks found)

I would really appreciate your help

pointbiz commented 2 years ago

You need to use version 3.2. You are running 3.3 and it needs a newer version of nodejs that's not in the current Ubuntu LTS.

You need nodejs 12.9+

emanhu commented 2 years ago

thanks :)