Home
Support Forums

Cypress plugin and Lighthouse plugin erroring with dependencies

Hi,

I’m getting the following error when using the netlify-plugin-cypress v2.2.0 and @netlify/plugin-lighthouse v2.1.2 which is stopping my site from deploying. If I remove each plugin, it builds and deploys fine.

Cypress error

Lighthouse error
12:22:10 PM: LH:ChromeLauncher Waiting for browser… +502ms
12:22:10 PM: LH:ChromeLauncher:error connect ECONNREFUSED 127.0.0.1:36347 +2ms
12:22:10 PM: LH:ChromeLauncher:error Logging contents of /tmp/lighthouse.v6lgKkb/chrome-err.log +0ms
12:22:10 PM: LH:ChromeLauncher:error /opt/build/repo/node_modules/puppeteer/.local-chromium/linux-901912/chrome-linux/chrome: error while loading shared libraries: libgbm.so.1: cannot open shared object file: No such file or directory
12:22:10 PM: LH:ChromeLauncher:error +0ms
12:22:10 PM: ​
12:22:10 PM: Creating deploy upload records
12:22:10 PM: (@netlify/plugin-lighthouse onPostBuild completed in 25.1s)

The build image is the latest Ubuntu Focal 20.04 (default). I’m using node 14.17.5 and npm
6.14.14. Cypress version 8.3.0.

It looks to be the same cause but I’m not sure how to fix it?
error while loading shared libraries: libgbm.so.1: cannot open shared object file: No such file or directory

LH:ChromeLauncher:error /opt/build/repo/node_modules/puppeteer/.local-chromium/linux-901912/chrome-linux/chrome: error while loading shared libraries: libgbm.so.1: cannot open shared object file: No such file or directory

If anyone has advice it will be appreciated.

Thank you.

Hey there, @eleanor-g :wave:

Welcome to the Netlify Forums! Thanks for the detailed write-up here. Could you also share your netlify site as well as your repo? That will help us look into this further.

Thank you!

Hi @hillary.

Thanks for replying. The site is https://wizardly-beaver-d450a2.netlify.app/. I won’t be able to share the repo as its a private repo but I can provide the .toml file or snippets from the package.json, if thats any help?

Hey there, @eleanor-g

Your package.json and the .toml file would be helpful! Additionally, take a look at this thread: Deploy failed due to an error in netlify-plugin-cypress plugin there are some steps in there from one of our Support Engineers that you may want to try out!

Hi @hillary

Thank you. This is the toml file its pretty simple.

[build]
  command = "./scripts/deploy-netlify.sh"
  publish = "build/dist/latest/"

  [functions]
    directory = "api/netlify/functions"

  [[redirects]]
    from = "/*"
    to = "index.html"
    status = 200

  # Plugins
  [[plugins]]
    package = "netlify-plugin-cypress"

  [[plugins]]
    package = "@netlify/plugin-lighthouse"

    [plugins.inputs]
    output_path = "reports/lighthouse.html"

  ## More info on configuring this file: https://www.netlify.com/docs/netlify-toml-reference/

I’ve also tried to use the cypress cache folder like, this also failed.

[build.environment]
# cache Cypress binary in local "node_modules" folder
# so Netlify caches it
CYPRESS_CACHE_FOLDER = "./node_modules/CypressBinary"
# set TERM variable for terminal output
TERM = "xterm"

[[plugins]]
# runs Cypress tests against the deployed URL
package = "netlify-plugin-cypress"

So looking at the post you linked to. I downgraded the build image to Ubuntu Xenail 16.04 from Ubuntu Focal 20.04 and it works fine.

Does that mean there is an issue with the Ubuntu Focal 20.04 image and do I need to log that issue somewhere?

Thanks

Hey there, @eleanor-g :wave:

So glad to hear that downgrading the build image to Ubuntu Xenial worked. This is the solution for now. We have an issue open internally and I have filed this instance on it, so we do not need anything else on your end!

Thank you @hillary for all your help :slight_smile: