changedetection.io icon indicating copy to clipboard operation
changedetection.io copied to clipboard

Cannot read properties of null (reading 'scrollTop') at eval

Open blippercop opened this issue 3 years ago • 13 comments

Describe the bug I often get an error for checks: TypeError: Cannot read properties of null (reading 'scrollTop') at eval (eval at evaluate (:191:30), :12:67) at UtilityScript.evaluate (:198:19) at UtilityScript. (:1:44)

If i manually click recheck it works (sometime it takes two tries) without changing the element.

What causes this?

Version v0.40.0.3

To Reproduce You cant. It happens randomly. But there are multiple elements that have that error and it are not always the same items it seems.

! ALWAYS INCLUDE AN EXAMPLE URL WHERE IT IS POSSIBLE TO RE-CREATE THE ISSUE - USE THE 'SHARE WATCH' FEATURE AND PASTE IN THE SHARE-LINK! As said it happens randomly and works if I click recheck - URL is useless but here: https://www.parallels.com/de/products/desktop/buy/?full

Expected behavior A clear and concise description of what you expected to happen.

Screenshots Github throws an error uploading a jpg / png.

Desktop (please complete the following information): Docker with playwright

blippercop avatar Dec 26 '22 20:12 blippercop

If you put 10 seconds into the Request > Wait seconds before extracting text does it solve it?

dgtlmoon avatar Dec 27 '22 08:12 dgtlmoon

I have the same error for many items. They all had a 4 seconds wait time. Trying now with 10 but I think it's another issue.

wajdi-b avatar Dec 30 '22 17:12 wajdi-b

Another similar error I see since the update with an item that contains javascript commands. I think it is related to the root cause.

Page request from server didnt respond correctly - TypeError: Cannot read properties of null (reading 'click') at eval (eval at evaluate (:191:30), <anonymous>:1:45) at eval (<anonymous>) at UtilityScript.evaluate (<anonymous>:191:30) at UtilityScript.<anonymous> (<anonymous>:1:44)

wajdi-b avatar Dec 30 '22 17:12 wajdi-b

I'm experiencing the same issue lately. added a ten second delay, will see if that fixes it. had a 4 second delay before.

// edit: nope, still seems to occur occacionally on mutliple items

martinjuhasz avatar Dec 31 '22 23:12 martinjuhasz

Same here, happens randomly on multiple items, delay doesn't seem to matter (tried with none/5/10/15 seconds).

Error like with [Lapsusone] above: TypeError: Cannot read properties of null (reading 'scrollTop') at eval (eval at evaluate (:191:30), <anonymous>:12:67) at UtilityScript.evaluate (<anonymous>:198:19) at UtilityScript.<anonymous> (<anonymous>:1:44)

and this is without any additional setup (no javascript before change detection etc).

ekasprzak avatar Jan 04 '23 09:01 ekasprzak

This appears to have replaced the message of the issue behind https://github.com/dgtlmoon/changedetection.io/issues/755

All the same checks that failed randomly with #755 on my end, now appear to fail with TypeError: Cannot read properties of null

wrobelda avatar Jan 07 '23 00:01 wrobelda

@wrobelda nothing at all todo with #755

A simple search shows me the error comes from here

https://github.com/dgtlmoon/changedetection.io/blob/master/changedetectionio/res/xpath_element_scraper.js#L12

So putting 2 and 2 together, it tells me that this script is running when the browser is not ready, I dont know why that is (yet)

ideas?

dgtlmoon avatar Jan 07 '23 18:01 dgtlmoon

that code gets called after all waiting/delays running steps etc.. so it should be ready for the browser..

dgtlmoon avatar Jan 07 '23 18:01 dgtlmoon

Another error that might be related that I see on an item with nothing else than wait time set at 10s.

Screenshot unavailable, page did not render fully in the expected time - try increasing 'Wait seconds before extracting text'

wajdi-b avatar Jan 07 '23 18:01 wajdi-b

I was getting this error when I had ad-block enabled in playwright. Disabling it seems to have resolved it. Could just be anecdotal at this point though.

sclarkso avatar Jan 16 '23 05:01 sclarkso

I was getting this error when I had ad-block enabled in playwright. Disabling it seems to have resolved it. Could just be anecdotal at this point though.

This also fixed things for me. DEFAULT_BLOCK_ADS=false or comment it out in the docker-compose for playwright-chrome

djak250 avatar Jan 20 '23 00:01 djak250

@sclarkso thanks a lot for that advice!

After a week of testing I can also confirm this problem is gone when adblock is disabled, in my case it also fixed few other (like some sites detecting that it is a robot and forcing CAPTCHA for a human check - no more of that after disabling adblock).

ekasprzak avatar Jan 23 '23 09:01 ekasprzak

Same here. No more issues.

wrobelda avatar Jan 23 '23 15:01 wrobelda

Thanks for the fix!

vbc4ejyg avatar Feb 03 '23 06:02 vbc4ejyg

I was getting this error when I had ad-block enabled in playwright. Disabling it seems to have resolved it. Could just be anecdotal at this point though.

Thanks, that fixed it for me too!

timothyquan avatar Mar 30 '23 14:03 timothyquan

I can confirm TypeError: Cannot read properties of null is resolved by setting DEFAULT_BLOCK_ADS=false for me.

I was on a much older version of changedetection and upgraded to the latest recently. After encountering these errors, I tried various strategies such as increasing the timeout, deleting the watch and re-adding, etc., but none of those helped until the above suggested change.

Thanks @sclarkso & @djak250

mckelvym avatar Apr 26 '23 09:04 mckelvym

Commenting to confirm my error is fixed as well after ad-block disabling: TypeError: Cannot set properties of undefined at eval when adding Javascript to execute to watches.

jonoff avatar Oct 10 '23 02:10 jonoff