Continue on "Cannot read property length of undefined"
try/catch exception, because things arent meant to stop in PROD..
My only issue with ignoring things like this is that there's a reason we're looking at X for a value, if the value isn't there, then something is wrong. Ignoring and moving on (skipping) transactions or blocks probably isn't what you want to do in PROD either. Instead, the "Cannot read property length of undefined" needs to be investigated for why are we looking for a value that doesn't exist.
I found an instance where 'coinbase' had been renamed in the coind output, so it was trying to read an invalid object...
Right, so because you're skipping rather than coding it in, you're missing all of these "coinbase" txes. I don't know why you'd want to do that. Instead, either the coin needs to be fixed or a better fix for the explorer needs to be coded in.
While I'm in agreement that error handling is still lacking, skipping things aren't the answer imo
So the end result is; rather than letting it pass and display results which might have missing information - you want to just have the explorer halt?
Exactly, the halt is on the backend process (the sync.js) and related functions that go with that. So either create a PR that is inclusive of your coin in an elegant way, fix your coin (make a PR to the coin), or let it halt because your Coin's results are missing information, information that is important for transaction history, total coin count, etc.
Address the problem, don't ignore it.
On Mon, Aug 12, 2019 at 7:48 AM barrystyle [email protected] wrote:
So the end result is; rather than letting it pass and display results which might have missing information - you want to just have the explorer halt?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/iquidus/explorer/pull/297?email_source=notifications&email_token=AAG2F5DNWBMK7ZXPJEZTPFDQEFEXBA5CNFSM4IK4HV2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4CJAQQ#issuecomment-520392770, or mute the thread https://github.com/notifications/unsubscribe-auth/AAG2F5FIUN7PVSWKBVCURWLQEFEXBANCNFSM4IK4HV2A .
I'm confused and struggling to figure out why you would think this is a good idea to do.
You're effectively saying this: Line 641: if block variable is defined then Line 642: start the try/catch Line 643-647: do normal block parsing Line 648: if any error at all comes up, just skip it.
Any error, not even the coinbase one that the other user brought up. No error message, no logging, can't even troubleshoot it in dev.
So yes, I am saying that the current method of crashing sync.js when a non-compliant coin is introduced that we weren't coded for is WAY better than skipping over the problem.
If you're set on keeping it this way, then keep it as your own fork, but in this PR's current state, no..I don't agree with the changes at all.
My solution was to rewrite sync and database to look for the altered name... I will submit a PR when I have time. Not sure how many people this will affect, but it is something that others may run across, and should be aware of if they are having similar problems. I found the issue by importing util and console.logging the objects that were causing the issue...
I think i may be missing the issue. but if this is due to receiving the error Cannot read property length of undefined it is more likely due
- the chain hasn't passed the transaction you set in the settings file and just need to let it fully sync. (from my understanding its to ensure wallet is on the right chain. or
- forgot to use
npm install --production
Its due to iquidus looking for a json object/item that doesn't exist in a given reply.
baz
On 12/04/2020 8:48 am, krewshul wrote:
I think i may be missing the issue. but if this is due to receiving the error |Cannot| read property length of undefined` it is more likely due
- the chain hasn't passed the transaction you set in the settings file and just need to let it fully sync. (from my understanding its to ensure wallet is on the right chain. or
- forgot to use |npm install --production|
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/iquidus/explorer/pull/297#issuecomment-612544823, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADL537QIBBEJJTYDV2RQRULRMEFU7ANCNFSM4IK4HV2A.