Puppeteer fails on CircleCI

HI. Thanks for the response.

I believe the problem has to do with puppeteer having it’s own version of chromium to insure compatibility rather than using chrome in the docker. Thus the missing libraries in the error report.

The errors are, for each launch of puppeteer, this:
name: AssertionError
message: Rejected promise returned by test
values: {“Rejected promise returned by test.
Reason:”:“Error {\n message: Failed to launch chrome!␊\n /home/circleci/repo/node_modules/puppeteer/.local-chromium/linux-555668/chrome-linux/chrome: error while loading shared libraries: libXcomposite.so.1: cannot open shared object file: No such file or directory␊\n ␊\n ␊\n TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md␊\n,\n}”}
at: onClose (node_modules/puppeteer/lib/Launcher.js:255:14)

Here’s the config:

version: 2
jobs:
build:
docker:
  - image: circleci/node

working_directory: ~/repo

steps:
  - checkout

  - restore_cache:
      keys:
        - v1-dependencies-{{ checksum "package.json" }}

  - run: yarn install

  - run: yarn build

  - run:
      command: mkdir -p ~/reports

  - run:
      command: |
        ./node_modules/ava/cli.js --tap | ./node_modules/tap-xunit/bin/tap-xunit > ~/reports/ava.xml
      when: always

  - store_test_results:
      path: ~/reports

  - store_artifacts:
      path: ~/reports

  - save_cache:
      paths:
        - node_modules
      key: v1-dependencies-{{ checksum "package.json" }}