uaktags / explorer

An open source block explorer
BSD 3-Clause "New" or "Revised" License
6 stars 8 forks source link

TypeError: Cannot read property 'proof-of-work' of undefined #47

Closed HotSwapp closed 5 years ago

HotSwapp commented 5 years ago

TypeError: Cannot read property 'proof-of-work' of undefined at /home/user/explorer/routes/index.js:356:19 at Request._callback (/home/user/explorer/lib/explorer.js:80:14) at self.callback (/home/user/explorer/node_modules/request/request.js:185:22) at Request.emit (events.js:198:13) at Request.onRequestError (/home/user/explorer/node_modules/request/request.js:881:8) at ClientRequest.emit (events.js:198:13) at Socket.socketErrorListener (_http_client.js:392:9) at Socket.emit (events.js:198:13) at emitErrorNT (internal/streams/destroy.js:91:8) at emitErrorAndCloseNT (internal/streams/destroy.js:59:3) at process._tickCallback (internal/process/next_tick.js:63:19)

api section works fine and is getting all the info such as get difficulty.

The coin has worked with the older explorers.

uaktags commented 5 years ago

What node vers and coin are you running. This seems like a very strict typing of javascript to sit there an puke on if (difficulty['proof-of-work']) {

This is no different than official Iquidus so I have doubts that it always worked before in your environment if nothing else changed (npm modules won't change this, and the code itself is exactly the same)

https://github.com/iquidus/explorer/blob/bf99bb56eb4f0437c59d54a424882c2f839ca521/routes/index.js#L284-L287

vs

https://github.com/uaktags/explorer/blob/06d8229a97548633dd1de8b013b37b22f93c28bd/routes/index.js#L353-L356

HotSwapp commented 5 years ago

Sorry, this is a new install on ubuntu 18 so my post was misleading. It works on a different version of an explorer on 16.04.

node v10.16.0 npm v6.9.0

HotSwapp commented 5 years ago

I added another coin to test it and it's giving the same error.

Then I install ubuntu 16 and am getting the same error.

uaktags commented 5 years ago

What coins? I have it testing on multiple OSes, node versions, and coins. There has been absolutely no changes to this code, so your issue should be present in Iquidus too. Can't do anything though about it unless I can reproduce it.

On Thu, Jul 25, 2019, 10:44 PM HotSwapp notifications@github.com wrote:

I added another coin to test it and it's giving the same error.

Then I install ubuntu 16 and am getting the same error.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/uaktags/explorer/issues/47?email_source=notifications&email_token=AAG2F5CKWW45HWQFY5YUWK3QBJQJJA5CNFSM4IFUQLUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD23KQJY#issuecomment-515287079, or mute the thread https://github.com/notifications/unsubscribe-auth/AAG2F5DU6235GVPLYPQOUW3QBJQJJANCNFSM4IFUQLUA .

uaktags commented 5 years ago

Yea, there's nothing else I can suggest for you. You're going to have to do some legwork yourself. There's no reason that we should have to go the strict route of if(typeof difficulty['proof-of-work'] !== 'undefined'){, javascript is more than capable of seeing the current code as "false" if it doesn't exist. Even using 'use strict'; the code doesn't error out (difficultyHybrid does, but that's because there's no var to declare it, still unneccessary imo). Labelling this as WontFix, if you find an elegant reason how to fix your issue or want to do a pull request, then by all means, but I'm not putting much more time to this until it can be reproduced and shown where the issue is.

HotSwapp commented 5 years ago

What are your recommended versions for everything? I see you still recommend 2.6 mongo versus 3.6 or 4 which I have tried all 3. The coin is based on DogeCash.

Did you have a coin that you know works that I can install on my system to test?

uaktags commented 5 years ago

I don't have any recommendations, everything in the readme comes from the original project. I can tell you this isn't mongo related at all and but I use 4. I've used Bitcoin, cpucoin, vulcano, xp xpc

HotSwapp commented 5 years ago

I have tried different versions of node, ubuntu, and 4 different coins, hyrbids, masternodes, and pow only and still get the same error on all of them. I can not figure out how to fix it so ill just close this and go back to the other explorer. Thanks for your time!