Encountering an issue while running my Cypress test on Buildkite. Here's the error message:
Status: Downloaded newer image for cypress/included:6.1.0
[2022-01-31T10:32:13Z] Your pluginsFile
is set to /e2e/cypress/plugins/index.js
, but either the file is missing, has a syntax error, or throws an error when required. The pluginsFile
must be a .js
, .ts
, or .coffee
file.
You may have mistakenly changed the extension of your pluginsFile
. In that case, please restart the test runner.
Please resolve this issue, or set pluginsFile
to false
if a plugins file is not needed for your project.
Error: Cannot find module 'xlsx' Require stack:
- /e2e/cypress/plugins/read-xlsx.js
- /e2e/cypress/plugins/index.js
The same test runs smoothly locally in both browser and headless modes
"xlsx" is listed in the package.json under both dependencies and dev dependencies.
Code snippet inside read-xlsx
const XLSX = require("xlsx");
const fs = require("fs");
const read = ({file, sheet}) => {
const buf = fs.readFileSync(file);
const workbook = XLSX.read(buf, { type: 'buffer' });
const rows = XLSX.utils.sheet_to_json(workbook.Sheets[sheet]);
return rows
}
module.exports = {
read
}
Seeking assistance from anyone who can help with this problem