[BUG] page.waitForSelector fails when called during a redirect
See original GitHub issueContext: System: OS: macOS 10.15.7 Memory: 226.13 MB / 32.00 GB Binaries: Node: 12.18.3 - /var/folders/sn/fccqtk995ll0h2b7wtp1z_z80000gr/T/fnm-shell-5071240/bin/node npm: 6.14.8 - /var/folders/sn/fccqtk995ll0h2b7wtp1z_z80000gr/T/fnm-shell-5071240/bin/npm Languages: Bash: 3.2.57 - /bin/bash
Describe the bug
Hi team. I’m seeing an issue with waitForSelector
throwing an error in some cases. When I call it during a series of server redirects, it’s throwing. However, if I use waitForTimeout
to let the redirects finish, and then call waitForSelector
, everything is fine.
// fill out a form and click "submit"
// this process redirects several times through various hostnames
await page.waitForSelector('.logo');
When I run this, I see this error:
UnhandledPromiseRejectionWarning: page.waitForSelector: Evaluation failed: TypeError: injected.pollRaf is not a function
at eval (__playwright_evaluation_script__217:3:25)
at UtilityScript.callFunction (__playwright_evaluation_script__206:305:24)
at UtilityScript.<anonymous> (__playwright_evaluation_script__227:1:44)
Or sometimes this error:
UnhandledPromiseRejectionWarning: page.waitForSelector: Protocol error (Runtime.callFunctionOn): Could not find object with given id
I’ve tried creating a minimal repro of this issue, but I’m struggling to get it to happen outside of my staging environment. Any suggestions for a potential way to repro this would be much appreciated.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (7 by maintainers)
Top GitHub Comments
@pixelastic This should be fixed with the next version of Electron itself, once the fix from Chromium is rolled in. So, if you plan to upgrade your Electron to the next version, things should work. I believe that Electron 12 that is based on Chromium M89 will have the fix.
When running against the ToT Playwright, I get the
Could not find object with given id
error in response toRuntime.callFunctionOn
.This seems to be caused by remote object ids clashing between different processes, e.g.
{\"injectedScriptId\":4,\"id\":1}
. This could also explain thepollRaf is not a function
error, in the case objectId is valid but points to a different type of object (not InjectedScript). From what I can see, WebKit might suffer from the same problem when swapping processes on navigation.