When utilizing Puppeteer you may intermittently encounter a build failure with the following error message:
ERROR: Failed to download Chromium r686378!
Your error may not be exactly the above,
r686378 is a reference to the version, so it could be another value. However, the general consensus is the following options have resolved the issue.
Set download host
An existing Puppeteer issue was opened regarding this and the following solution helped a lot of people, which is to set the download host specifically:
Set unsafe-perm param
A similar issue was opened by another Puppeteer user, however the solution was slightly different:
This solution has setting
unsafe-perm to true:
npm install puppeteer --unsafe-perm=true
Download Chromium Directly
To allow for more control over where and how you are downloading Chromium, you can download it directly. You could even implement a retry functionality into your cURL to ensure you get it downloaded.
Then you would utilize Puppeteers Environment Variables to skip the Chromium download and point it to where you manually downloaded Chromium.