Closed fastingsamurai closed 4 months ago
Experienced this as well. Do you have a fix now?
After a few hours of digging and testing, the only thing that makes everything work is the flag --disable-dev-shm-usage
mentioned here https://github.com/Zenika/alpine-chrome/issues/225#issue-1639376911. It was because /dev/shm partition is too small in some VMs, causing Chrome to crash
. Thanks to @sfcgeorge for documenting the flags.
So in your code the changes should be
spawn(
"/usr/bin/chromium-browser",
[
"--headless",
"--no-sandbox",
"--remote-debugging-address=0.0.0.0",
"--remote-debugging-port=9222",
+ "--disable-dev-shm-usage",
"about:blank",
],
{
detached: true,
}
);
Amazing!! Thank you so much! You're awesome!
Describe the bug When capturing a screenshot of an HTML page with a large jpeg image in it, instead of capturing a screenshot, Chrome will hang and refuse to respond to any further commands. This does not happen when running the same commands on the host OS, this is only reproducible in the alpine-chrome Docker container.
To Reproduce
chrome-bug.zip
What is the expected behavior?
The line "Screenshot captured" will eventually be printed to the console
What is the actual behavior?
Chrome will hang at some point in the loading process or when trying to take the screenshot itself. Once this happens the Chrome process seems to become totally unresponsive to any command sent by the remote interface.
Additional context
If you edit the page.html file and change "large.jpg" to "small.jpg", the script runs as expected. This issue only seems to happen when viewing larger images, around 1MB or greater.
This bug happens both on ARM and x64.