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

Race condition leading to Argument should belong to the same JavaScript world as target object #233

Open
aaronjensen opened this issue Apr 26, 2023 · 6 comments

Comments

@aaronjensen
Copy link

aaronjensen commented Apr 26, 2023

We are occasionally seeing this error come from Ferrum:

Argument should belong to the same JavaScript world as target object

From what I can tell, it may have to do with how cuprite handles finding within elements. If the page navigates in the middle of a find (in between the time when the within is resolved in Ruby to when the find is done) then the crash occurs.

page.within(:css, ".some-class") do
  page.find(:css, ".some-other-class")
end
@emilkarl
Copy link

emilkarl commented Feb 6, 2024

Did you solve this?

@aaronjensen
Copy link
Author

No, we have tended to avoid within for this reason. I haven't looked into it recently as a result.

@markedmondson
Copy link

Just started seeing this occurring frequently, but with no obvious changes. We do use within quite a lot as above but it had been fine for months/years...

@route
Copy link
Member

route commented Feb 1, 2025

@markedmondson something has changed on the js side maybe?

@markedmondson
Copy link

markedmondson commented Feb 3, 2025

@route I don't see anything immediately obvious but that's a good callout.

What's interesting is that it fails in CI (using CircleCI) only and not locally. Also it seems intermittent (so basically the worst kind!).

Edit: Got it - there was a Stimulus controller occasionally raising which seems to have caused this!

@route
Copy link
Member

route commented Feb 4, 2025

Intermittent issues like that often manifest themselves on CI due to its slowness. Lower memory ceiling, slower CPU and it fails more often in comparison to flying macbooks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants