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
[Regression]: page.waitForFunction
passes an unexpected first argument to pageFunction
since Puppeteer 13
#7836
Comments
We use string arguments in all other places, so these two places are a bit inconsistent in that sense. Moreover, it's just one argument now, which makes it a bit easier to read and see what it does because we don't have to pass the always-empty options argument anymore. Finally, doing it like this ensures it works in all Puppeteer versions given puppeteer/puppeteer#7836.
I am also experiencing a similar issue (trying to upgrade puppeteer to v13): GitHub Action Run
|
Looks like #7825 is now passing in the puppeteer/src/common/DOMWorld.ts Line 930 in a3d2300
puppeteer/src/common/DOMWorld.ts Line 940 in 3e3a90b
puppeteer/src/common/DOMWorld.ts Line 965 in 3e3a90b
puppeteer/src/common/DOMWorld.ts Line 982 in 3e3a90b
|
+1 |
Thanks for the report, I will take a look soon. |
The same predicate function is used by the waitForFunction API that does not need the context element. Issues: #7836
The same predicate function is used by the waitForFunction API that does not need the context element. Issues: #7836
@timvandermeij is there any ETA for release of this fix? By coincidence our project needs both fixes: this one and the one from 13.0.0 :) |
We use string arguments in all other places, so these two places are a bit inconsistent in that sense. Moreover, it's just one argument now, which makes it a bit easier to read and see what it does because we don't have to pass the always-empty options argument anymore. Finally, doing it like this ensures it works in all Puppeteer versions given puppeteer/puppeteer#7836.
We use string arguments in all other places, so these two places are a bit inconsistent in that sense. Moreover, it's just one argument now, which makes it a bit easier to read and see what it does because we don't have to pass the always-empty options argument anymore. Finally, doing it like this ensures it works in all Puppeteer versions given puppeteer/puppeteer#7836.
We use string arguments in all other places, so these two places are a bit inconsistent in that sense. Moreover, it's just one argument now, which makes it a bit easier to read and see what it does because we don't have to pass the always-empty options argument anymore. Finally, doing it like this ensures it works in all Puppeteer versions given puppeteer/puppeteer#7836.
Bug description
For Mozilla's PDF.js we use Puppeteer for our integration tests. The upgrade from Puppeteer 12.0.1 to 13.0.0 made one test fail and investigation showed that there is a regression in Puppeteer 13.
Steps to reproduce the problem:
npm
.repro.js
with the following minimal reproducer:node repro.js
and notice no errors being logged (browser starts and no output is logged). This is expected.npm
.node repro.js
and and notice that it fails all of a sudden, with the following logged exception:This is unexpected because nothing in the changelogs indicates a change in behavior here. Moreover, the API documentation at https://github.com/puppeteer/puppeteer/blob/main/docs/api.md#pagewaitforfunctionpagefunction-options-args clearly states, and even includes an example of, that
pageFunction
only gets the arguments we give it.However, in Puppeteer 13 I found after debugging all of a sudden the first argument to
pageFunction
is thedocument
object for some reason, and the other arguments are shifted, so the second argument is what used to be the first one in Puppeteer 12.0.1, et cetera. This is why it fails: thedocument.querySelector
call gets thedocument
object as argument now since Puppeteer 13 put that inside the_selector
argument.Note that this happens in both Chrome and Firefox, so it's not browser-specific.
Puppeteer version
13.0.0
Node.js version
17.1.0
npm version
8.1.3
What operating system are you seeing the problem on?
Linux
Relevant log output
(see above)
The text was updated successfully, but these errors were encountered: