How to use with puppeteer? #434

Closed
opened 2025-08-09 17:16:16 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @chris-herring on 9/10/2017

What's the best way to invoke a script that uses puppeteer? Puppeteer is an API over headless chrome and as part of the install it downloads a version of Chrome. Using webpack to bundle the script as per the existing client/server scripts will not work as the bundle won't include the Chrome exe.

My thoughts are

  1. Grab the Chrome exe and put it in a separate directory in the app that is included in the deployment. Puppeteer provides an option to set the path to the exe so use this in the script. The script can be bundled. The downside is issues with cross-platform deployment (as you're including the exe yourself) and also needing to manually maintain the matching Chrome version to the puppeteer version.
  2. Don't bundle the scripts and after deployment manually npm install puppeteer (and any other dependencies). The downside is you lose the benefit of being able to bundle the scripts up and avoid issues with node_modules at deployment.

Is there a better way?

*Originally created by @chris-herring on 9/10/2017* What's the best way to invoke a script that uses [puppeteer](https://github.com/GoogleChrome/puppeteer)? Puppeteer is an API over headless chrome and as part of the install it downloads a version of Chrome. Using webpack to bundle the script as per the existing client/server scripts will not work as the bundle won't include the Chrome exe. My thoughts are 1. Grab the Chrome exe and put it in a separate directory in the app that is included in the deployment. Puppeteer provides an option to set the path to the exe so use this in the script. The script can be bundled. The downside is issues with cross-platform deployment (as you're including the exe yourself) and also needing to manually maintain the matching Chrome version to the puppeteer version. 2. Don't bundle the scripts and after deployment manually npm install puppeteer (and any other dependencies). The downside is you lose the benefit of being able to bundle the scripts up and avoid issues with node_modules at deployment. Is there a better way?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#434
No description provided.