You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In scenarios where Chrome would not necessarily be guaranteed to be installed (e.g. CI environments, "end user machines" via npx some-thing) and in those cases using spawnChrome will error (lazily when you actually try to "do something" the first time).
puppeteer "solves" this by always installing Chrome during puppeteers postinstall hook, which takes a bit of time during installation. This ensures that all users have Chrome installed and therefore that puppeteer itself works, but since most of the time the user will already have Chrome installed this leads to wasted work / time.
Proposal
Add a new method (straw man name): spawnOrInstallChrome that will attempt to use the ambiently available Chrome instance (I'm assuming it can literally use spawnChrome for this part), and if an ambient Chrome is not available fall back to fetching Chrome before continuing.
This would reduce wasted time (vs puppeteer's setup and vs setting up Chrome eagerly in CI environments that already have it), but still allow tools that run on "uncontrolled environments" work without putting this problem on the authors of those tools.
Motivation
In scenarios where Chrome would not necessarily be guaranteed to be installed (e.g. CI environments, "end user machines" via
npx some-thing
) and in those cases usingspawnChrome
will error (lazily when you actually try to "do something" the first time).puppeteer "solves" this by always installing Chrome during
puppeteer
spostinstall
hook, which takes a bit of time during installation. This ensures that all users have Chrome installed and therefore thatpuppeteer
itself works, but since most of the time the user will already have Chrome installed this leads to wasted work / time.Proposal
Add a new method (straw man name):
spawnOrInstallChrome
that will attempt to use the ambiently available Chrome instance (I'm assuming it can literally usespawnChrome
for this part), and if an ambient Chrome is not available fall back to fetching Chrome before continuing.This would reduce wasted time (vs puppeteer's setup and vs setting up Chrome eagerly in CI environments that already have it), but still allow tools that run on "uncontrolled environments" work without putting this problem on the authors of those tools.
Additional Information
See here for how puppeteer fetches and installs Chrome
Example project that needs to be able to run on arbitrary machines (when we cannot know ahead of time that Chrome is installed)
The text was updated successfully, but these errors were encountered: