-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Map tiles aren't rendering in headless chrome (via puppeteer) #7721
Comments
I can't reproduce this behavior with your test script. I'm seeing both screenshots rendered correctly with headless and non-headless Chromium. I used Puppeteer v1.11.0 and then rolled back to 1.5.0 since there were reports of issues rendering WebGL on some older versions, but again I couldn't replicate the behavior you're describing. I used Node 8.5 and 10.13 for what it's worth. |
From experience here are some things that have made a difference to me:
I don't think this is an issue with Mapbox GL JS, it's a chromium issue. |
I have this same issue but only when trying to render local mapboxgl files. The fixes of switching to google-chrome didn't help. |
Seems to be a puppeteer/chromium issue. While calling |
For anyone searching for solutions in 2020, I'll add that this is probably what you're looking for. No need to fiddle with unstable/beta versions of Chromium if you're using a recent build of Puppeteer. I've experimented with this lately, and the tiles won't show up in the PDF (or screenshot) even if I add a long delay to allow for everything to definitely load. You can make Puppeteer wait for a promise to resolve on the target page, so if you resolve that promise when the map fires its |
I'm seeing this issue when I try to render a PDF containing a mapbox-gl-js map on the latest release of Puppeteer (5.3.1) on Ubuntu server 18.04 LTS. I've tried using the bundled Chromium version and latest releases of Chrome and Chrome Beta - all give the same result. I've tried setting the If I set
There appears to be an issue on the Chromium bug tracker for a WebGL issue in headless mode: https://bugs.chromium.org/p/chromium/issues/detail?id=809065&q=mapbox&can=2 |
Same problem here, any update? |
I fixed this by adding the --use-angle flag as recommended here: https://groups.google.com/a/chromium.org/g/chromium-dev/c/8eR2GctzGuw/m/seHvu1jTAAAJ |
mapbox-gl-js version: latest
browser: Chromium headless on Ubuntu
Steps to Trigger Behavior
this script uses puppeteer to create two screenshots in headless chromium. the first is of https://get.webgl.org/ to confirm that webgl is enabled:
webgl.org screenshot in headless mode
the second is a screenshot of this live mapbox map demo from your website
mapboxgl screenshot in headless mode
If I run the same script with
headless: false
the second screenshot works just fine.Link to Demonstration
the script above (just need to run
npm i puppeteer
first.Expected Behavior
the expected behavior would be that the mapboxgl map renders as it does if I use the non-headless mode:
mapbox screenshot in non-headless mode
Actual Behavior
see first screenshot
The text was updated successfully, but these errors were encountered: