jaredpalmer / cypress-image-snapshot

Catch visual regressions in Cypress
MIT License
888 stars 160 forks source link

when running thro' Jenkins gives me error of plugins file is missing or invalid. #145

Open RakheeC opened 4 years ago

RakheeC commented 4 years ago

The plugins file is missing or invalid.

Your `pluginsFile` is set to `/opt/app/cypress/plugins/index.js`, but either the file is missing, it contains a syntax error, or threw an error when required. The `pluginsFile` must be a `.js`, `.ts`, or `.coffee` file.

Or you might have renamed the extension of your `pluginsFile`. If that's the case, restart the test runner.

Please fix this, or set `pluginsFile` to `false` if a plugins file is not necessary for your project.

 Error: Cannot find module 'cypress-image-snapshot/plugin'

``` Git Repo already has index.js . It works fine on local. We run thro' docker image. Do I have to update anything in docker file? 
thielium commented 3 years ago

const { addMatchImageSnapshotPlugin } = require("cypress-image-snapshot/plugin"); appears to do the trick. Perhaps it's a node version issue, which is why it only shows up in some environments?