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

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

Open
blippercop opened this issue Dec 26, 2022 · 17 comments
Open

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

blippercop opened this issue Dec 26, 2022 · 17 comments
Assignees
Labels

Comments

@blippercop
Copy link

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

@dgtlmoon
Copy link
Owner

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

@wajdi-b
Copy link

wajdi-b commented Dec 30, 2022

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
Copy link

wajdi-b commented Dec 30, 2022

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)

@martinjuhasz
Copy link

martinjuhasz commented Dec 31, 2022

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

@ekasprzak
Copy link

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).

@wrobelda
Copy link

wrobelda commented Jan 7, 2023

This appears to have replaced the message of the issue behind #755

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

@dgtlmoon
Copy link
Owner

dgtlmoon commented Jan 7, 2023

@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
Copy link
Owner

dgtlmoon commented Jan 7, 2023

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

@wajdi-b
Copy link

wajdi-b commented Jan 7, 2023

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'

@sclarkso
Copy link

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.

@djak250
Copy link

djak250 commented Jan 20, 2023

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

@ekasprzak
Copy link

@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).

@wrobelda
Copy link

Same here. No more issues.

@madfusker
Copy link

Thanks for the fix!

@timothyquan
Copy link

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!

@mckelvym
Copy link

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

@jonoff
Copy link

jonoff commented Oct 10, 2023

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.

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