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

Upgrading puppeteer to 22.x #271

Closed
akaspick opened this issue Dec 7, 2024 · 8 comments
Closed

Upgrading puppeteer to 22.x #271

akaspick opened this issue Dec 7, 2024 · 8 comments

Comments

@akaspick
Copy link
Contributor

akaspick commented Dec 7, 2024

Any "gotchas" with upgrading to version 22 or greater of puppeteer with the most recent version of this gem? I can generate my PDFs without issue with puppeteer 21, but generation fails (timeeouts) starting at version 22.

I saw in the release notes for puppeteer 22 that wait_for_timeout was removed, but I've been using wait_for_function, so that change shouldn't affect me.

https://github.com/puppeteer/puppeteer/releases/tag/puppeteer-core-v22.0.0

Anything else I should be taking into consideration?

@abrom
Copy link
Contributor

abrom commented Dec 10, 2024

hey @akaspick every version of puppeteer tends to change something.. but it's hard to say how that would affect you without knowing more. My most recent tests ran against v22.15.0 and v23.2.1 (list is always updating as newer versions are released) and haven't shown any issues.

If you search through processor_spec.rb for puppeteer_version_on_or_after? you'll see the places where i've had to tweak the spec copy/function to handle the different versions accordingly (including some v22+ things), but none of those AFAIK would cause timeouts.

I'd suggest you start with the debugging section of the readme, and/or rendering a cut back version of the page until things start working again to help trace the problem

@akaspick
Copy link
Contributor Author

@abrom Thanks for the suggestions. I'll take a look at the spec and the debugging options to see if that leads me to any solutions. If it helps, I'll post my solution here if I can get it working. V23 doesn't work either, it's just my PDF generation stopped working at V22.

@akaspick
Copy link
Contributor Author

@abrom My testing is being done locally over HTTP and my url was being converted to HTTPS even though I'm providing "http://myapp:3000" for my display_url.

Specifying launch_args: ['--disable-features=HttpsUpgrades'] resolved the issue.

@abrom
Copy link
Contributor

abrom commented Dec 11, 2024

Ahh, good catch 👍

Unfortunately my use case is rendering HTML directly to the browser and not from a local HTTP server. TBH i'm not sure there would be a nice way to have identified that. Hmm

What would be good would be a small blurb in the README to explain this to others. Would you be interested in writing something up? (ie a PR)

@akaspick
Copy link
Contributor Author

Could/should grover automatically add --disable-features=HttpsUpgrades if it detects the page request as http://?

@abrom
Copy link
Contributor

abrom commented Dec 11, 2024

hmm i'm not sure about that, as it defeats the purpose of the feature. But I can see a warning being displayed as a possible option

@akaspick
Copy link
Contributor Author

@abrom #272

Hopefully helpful.

@abrom
Copy link
Contributor

abrom commented Dec 12, 2024

Nice one, thanks @akaspick

I'll have a bit of a think about how an automated warning mechanism might work 😄

@abrom abrom closed this as completed Jan 13, 2025
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

2 participants