-
Notifications
You must be signed in to change notification settings - Fork 114
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
Fix #121: stylesheets/images rendering with puppeteer v10.2.0 #122
Conversation
Good find @mkalygin 👍 Although I did see that Puppeteer will occasionally error out using this solution with:
What did appear to work ok was:
Thoughts? |
@abrom I'm wondering how is it even possible, given that I use two Are you saying that Is there any way to repro it? Or are you referring to some previous observations of that issue? Overall I'm fine with doing what you suggest. I just didn't see a reason to intercept subsequent requests with |
Good question! But I don't have an answer. I'm thinking it's a timing thing where the browser is going ahead and starting the next request BEFORE the request interception has been disabled. Maybe the error message is just a bit confusing? In any case, easy enough to test it:
|
I would note that the CI was only passing because it was set to test up to v10.1.0. I pushed an update in #123 to include v10.2.0 yesterday so if you rebase that should give a better idea of what the state of the issue is. Something tells me we haven't got to the bottom of this if your fix crashes for me and mine hangs for you! |
By the way, did you copy my entire snippet ? Note that it needs to be |
@abrom you're absolutely right, I didn't notice this change. :–) Updated the PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one @mkalygin thanks!
FYI released in v1.0.3 |
In puppeteer v10.2.0 they introduced changes to the way request interception handlers are processed:
It caused a race condition in processing between two handlers (
page.once
andpage.on
). So I fixed this problem by properly awaiting response and disabling interception.