
It can only execute one process at a time. You see Node.js in its core is a single-threaded system. However, if you have to download multiple large files things start to get complicated. In this next part, we will dive deep into some of the advanced concepts. If you are using an EC2 instance running amazon-linux in your CI/CD pipeline,Īnd if you want to run Puppeteer tests in amazon-linux, follow these steps.Const browser = await puppeteer. Running Puppeteer on AWS EC2 instance running Amazon-Linux (supports up to puppeteer 10.1 - outdated).(a vendor and framework agnostic library that supports modern versions of chromium).

This presents challenges for running headlessĬhrome (and therefore Puppeteer) on Lambda. Simple guide from includes a sample project:ĭeployment package sizes to ~50MB. Use a buildpack with additional font files like

If you need to render Chinese, Japanese, or Korean characters you may need to On the next deploy, your app will also install the dependencies that When you click add buildpack, simply paste that url into the input, and click If you do, # you'll need to launch puppeteer with: # browser.launch(). # If running Docker >= 1.13.0 use docker run's -init arg to reap zombie processes, otherwise # uncomment the following lines to have `dumb-init` as PID 1 # ADD /usr/local/bin/dumb-init # RUN chmod +x /usr/local/bin/dumb-init # ENTRYPOINT # Uncomment to skip the chromium download when installing puppeteer. & apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 \ & sh -c 'echo "deb stable main" > /etc/apt//google.list' \ # Install latest chrome dev package and fonts to support major charsets (Chinese, Japanese, Arabic, Hebrew, Thai and a few others) # Note: this installs the necessary libs to make the bundled version of Chromium that Puppeteer # installs, work. To fix, you'll need to install the missing dependencies and the latest Chromium The bundledĬhromium that Puppeteer installs is missing the necessary shared library Getting headless Chrome up and running in Docker can be tricky.

Instructions below might be still helpful if you are building your own image. Starting from v16.0.0 we are shipping a Docker image via the In a Docker container until v3.0.x - see our historicalįor reference. 👋 We used Cirrus Ci to run our tests for Puppeteer To fix this, set jest -maxWorkers=2 in your test command. This is likely caused by Jest autodetecting the number of processes on theĮntire machine ( 36) rather than the number allowed to your container ( 2). Jest args: -e2e -spec -max-workers=36Īt ChildProcess.spawn (internal/child_process.js:394:11)
