Chromium / puppeteer on github actions and azure static web apps libX11-xcb.so.1 failure

832 views Asked by At

I'm building a vue/gridsome app that uses a critical css extract plugin. It all runs fine locally but I'm struggling with github action builds.

Extract critical CSS (1 pages)
Error: Failed to launch the browser process!
/github/workspace/node_modules/puppeteer/.local-chromium/linux-722234/chrome-linux/chrome: error while 
loading shared libraries: libX11-xcb.so.1: cannot open shared object file: No such file or directory

I've searched for solutions and it seems there are linux / unbuntu dependencies missing so I tried to add them to my yml workflow following this:https://medium.com/@cloverinks/how-to-fix-puppetteer-error-ibx11-xcb-so-1-on-ubuntu-152c336368

 steps:
  - uses: actions/checkout@v2
    with:
      submodules: true         
  - name: Req
    run: sudo apt install -y gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget
  - name: Build And Deploy
    id: builddeploy
    uses: Azure/[email protected]
    with:

It still fails, am I missing a step or is there a limitation with azure static web apps and github actions?

Thanks

2

There are 2 answers

1
CyberT33N On

Did you try this

sudo apt-get install ca-certificates fonts-liberation libappindicator3-1 libasound2 libatk-bridge2.0-0 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 lsb-release wget xdg-utils

2
AjayKumar On

This is a known issue and the following discussion thread has a workaround suggested: https://github.com/Azure/static-web-apps/issues/99

"Our product engineering team is aware of the issue, but unfortunately there is no ETA for a permanent fix. As Static Web Apps moves closer to General Availability (GA), a lot of these issues should be resolved as they are currently maturing the product out of public preview and trying to get it ready for GA."

To benefit the community: Copied the discussion that you had with my colleague Bryan on the Microsoft Q&A thread - Thanks for the follow-up and update, Michael. It's much appreciated.