Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@cypress/grep - env grepFilterSpecs: true in cypress.config.js throws a Cypress configuration error #27221

Closed
davidhornmarkINGKA opened this issue Jul 6, 2023 · 4 comments

Comments

@davidhornmarkINGKA
Copy link

davidhornmarkINGKA commented Jul 6, 2023

Current behavior

When using package @cypress/grep and setting environment variable grepFilterSpecs: true in the cypress.config.js.
configFile will throw an error while executing e2e.setupNodeEvents().

Setting grepFilterSpecs: false allows it to load.

Registered @cypress/grep in the config file according to the guide:
https://github.com/cypress-io/cypress/tree/develop/npm/grep#config-file

Set environment variable grepFilterSpecs according to:
https://github.com/cypress-io/cypress/tree/v12.11.0/npm/grep#pre-filter-specs-grepfilterspecs

error-message

Desired behavior

No response

Test code to reproduce

Created a bare minimum repo with auto generated files by Cypress.

https://github.com/davidhornmarkINGKA/cypress-grepFilterSpecs-issue

package.json:

{
  "name": "cypress-grepfilterspecs-issue",
  "version": "1.0.0",
  "description": "",
  "dependencies": {
    "@cypress/grep": "^3.1.5",
    "cypress": "^12.16.0"
  }
}

Example config:

const { defineConfig } = require("cypress");

module.exports = defineConfig({
  env: {
    grepFilterSpecs: true
  },
  e2e: {
    setupNodeEvents(on, config) {
      require('@cypress/grep/src/plugin')(config);
      return config;
    },
  }
});

Cypress Version

12.16.0

Node version

v18.16.1

Operating System

Windows 10.0.19045

Debug Logs

No response

Other

No response

@MikeMcC399
Copy link
Contributor

@davidhornmarkINGKA

@davidhornmarkINGKA
Copy link
Author

davidhornmarkINGKA commented Jul 6, 2023

@MikeMcC399
Thanks for the link. Searched for grepFilterSpecs but didn't find any issue on it so provided my own information here.

My current workaround is to not have grepFilterSpecs set and take the performance loss.

@ivan-verges
Copy link

This issue is caused by the new version of the fast-glob package (3.3.0).
To get a workaround, add manually this dependency to your packages.json file:
"fast-glob": "3.2.12"

@nagash77
Copy link
Contributor

nagash77 commented Jul 7, 2023

I am going to close this issue as a duplicate of #27216

@nagash77 nagash77 closed this as not planned Won't fix, can't repro, duplicate, stale Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants