{"record":{"id":"a4eb2d17b8cf0ff5","repo":"cypress-io/cypress","slug":"incompatible-versions-detected-cypress-grep-3-0","errorCode":null,"errorMessage":"Incompatible versions detected, @cypress/grep 3.0.0+ requires Cypress 10.0.0+","messagePattern":"Incompatible versions detected, @cypress/grep 3\\.0\\.0\\+ requires Cypress 10\\.0\\.0\\+","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"npm/grep/src/plugin.ts","lineNumber":27,"sourceCode":"interface CypressConfigOptions {\n  expose?: Record<string, any>\n  specPattern?: string | string[]\n  excludeSpecPattern?: string | string[]\n}\n\n/**\n * Prints the \"@cypress/grep\" environment values if any.\n * @param {Cypress.ConfigOptions} config\n */\nexport function plugin (config: CypressConfigOptions): CypressConfigOptions {\n  if (!config || !config.expose) {\n    return config\n  }\n\n  const { expose } = config\n\n  if (!config.specPattern) {\n    throw new Error(\n      'Incompatible versions detected, @cypress/grep 3.0.0+ requires Cypress 10.0.0+',\n    )\n  }\n\n  debug('@cypress/grep plugin version %s', version)\n  debug('Cypress config expose object: %o', expose)\n\n  const grep = expose.grep ? String(expose.grep) : undefined\n\n  if (grep) {\n    console.log('@cypress/grep: tests with \"%s\" in their names', grep.trim())\n  }\n\n  const grepTags = expose.grepTags || expose['grep-tags']\n\n  if (grepTags) {\n    console.log('@cypress/grep: filtering using tag(s) \"%s\"', grepTags)\n    const parsedGrep = parseGrep(null, grepTags)","sourceCodeStart":9,"sourceCodeEnd":45,"githubUrl":"https://github.com/cypress-io/cypress/blob/0d85fdc91230885bca0a91df278312800a48b727/npm/grep/src/plugin.ts#L9-L45","documentation":"Thrown by the @cypress/grep plugin entry when the resolved Cypress config has no `specPattern` property. `specPattern` was introduced in Cypress 10 to replace the old `testFiles` array, so its absence is treated as definitive proof the host Cypress is pre-10. @cypress/grep 3.0.0+ is built against the Cypress 10+ config shape and cannot operate on older majors.","triggerScenarios":"Calling `plugin(config)` from setupNodeEvents where the passed `config` object lacks `specPattern`. This occurs when @cypress/grep 3.x is installed in a project running Cypress 9.x or earlier (which uses `config.testFiles` and a different plugin signature), or when a custom config factory strips the property.","commonSituations":"Upgrading @cypress/grep without upgrading Cypress; using an old cypress.json-based project with the new grep; or a CI matrix that pins an old Cypress version while pulling the latest grep.","solutions":["Upgrade Cypress to 10.0.0 or newer (match the version called out in the message): `npm i -D cypress@latest`.","Confirm you migrated from cypress.json to cypress.config.{js,ts} — the specPattern property only exists on the new config.","Downgrade @cypress/grep to a 2.x release if you genuinely cannot upgrade Cypress.","Verify the plugin is wired in setupNodeEvents with the modern `(on, config) => { return plugin(config) }` shape."],"exampleFix":"// before: cypress 9 + cypress.json\n// plugins/index.js\nmodule.exports = (on, config) => { require('@cypress/grep/src/plugin')(config); return config }\n// after: cypress.config.ts (Cypress 10+)\nimport { defineConfig } from 'cypress'\nimport grep from '@cypress/grep/src/plugin'\nexport default defineConfig({\n  e2e: {\n    specPattern: 'cypress/e2e/**/*.cy.js',\n    setupNodeEvents (on, config) { grep(config); return config },\n  },\n})","handlingStrategy":"validation","validationCode":"import semverLt from 'semver/functions/lt.js'\nif (semverLt(Cypress.version, '10.0.0')) {\n  throw new Error('Upgrade Cypress to >=10 to use this version of @cypress/grep')\n}\nif (!config.specPattern) { /* do not call grep plugin; use older grep */ }","typeGuard":"const supportsSpecPattern = (c: any): boolean => Boolean(c && typeof c === 'object' && 'specPattern' in c && c.specPattern)","tryCatchPattern":"try { plugin(config) } catch (e) { if (/Incompatible versions/.test(e.message)) { /* upgrade Cypress or downgrade grep */ } else throw e }","preventionTips":["Pin @cypress/grep to a major compatible with your Cypress major in package.json.","Check Cypress.version and config.specPattern before invoking the grep plugin.","Keep Cypress and ecosystem plugins upgraded together in one PR."],"tags":["grep","version-mismatch","cypress-10","config","plugin"],"backgroundTag":null,"analyzedSha":"0d85fdc91230885bca0a91df278312800a48b727","analyzedAt":"2026-08-12T16:24:28.056Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}