{"record":{"id":"1847da70770f864d","repo":"cypress-io/cypress","slug":"unexpected-major-version-of-json-name-cypress","errorCode":null,"errorMessage":"Unexpected major version of ${json.name}. Cypress webpack-dev-server works with ${json.name} versions ${acceptedVersions.join(', ')} - saw ${json.version}","messagePattern":"Unexpected major version of (.+?)\\. Cypress webpack-dev-server works with (.+?) versions (.+?) - saw (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"npm/webpack-dev-server/src/sourceRelativeWebpackModules.ts","lineNumber":283,"sourceCode":null,"sourceCodeStart":null,"sourceCodeEnd":null,"githubUrl":"https://github.com/cypress-io/cypress/blob/0d85fdc91230885bca0a91df278312800a48b727/npm/webpack-dev-server/src/sourceRelativeWebpackModules.ts#L283","documentation":"Thrown by getMajorVersion in sourceRelativeWebpackModules.ts. When sourcing webpack, webpack-dev-server, or html-webpack-plugin relative to the user's project, Cypress reads each package's package.json, parses the version, takes the leading number as the major, and verifies it falls inside an explicit acceptedVersions list. Any major outside that allowlist is rejected because Cypress's webpack config merge logic is major-version-specific (e.g. html-webpack-plugin v4 vs v5 have incompatible option shapes).","triggerScenarios":"Installing a newer or older major of webpack, webpack-dev-server, or html-webpack-plugin than Cypress supports. For example html-webpack-plugin 6.x (only 4 and 5 are accepted) or webpack 6.x. The error message names the offending package and the accepted list, so it is self-diagnosing.","commonSituations":"Running `npm install webpack@latest` ahead of Cypress support, mixed majors in a monorepo where hoisting pulls the wrong version, or upgrading a starter template that pulls newer majors.","solutions":["Read the error: it names the package and the accepted majors (e.g. 'works with html-webpack-plugin versions 4, 5 - saw 6.0.0').","Downgrade (or upgrade) the offending package to a major in the acceptedVersions list: `npm install --save-dev html-webpack-plugin@5`.","Run `npm ls <package>` to detect duplicate installations and resolve hoisting conflicts.","If you must use an unsupported major, open an issue / PR against @cypress/webpack-dev-server to extend acceptedVersions."],"exampleFix":"// before\n\"html-webpack-plugin\": \"^6.0.0\"\n// after\n\"html-webpack-plugin\": \"^5.5.0\"","handlingStrategy":"validation","validationCode":"function checkMajorVersion (pkgJsonPath: string, accepted: number[]) {\n  const { name, version } = require(pkgJsonPath)\n  const major = Number(version.split('.')[0])\n  if (!accepted.includes(major)) {\n    throw new Error(`${name}@${version} unsupported; accepted majors: ${accepted.join(', ')}`)\n  }\n}","typeGuard":"function isAcceptedMajor (version: string, accepted: number[]): boolean {\n  return accepted.includes(Number(version.split('.')[0]))\n}","tryCatchPattern":null,"preventionTips":["Pin webpack, webpack-dev-server, and html-webpack-plugin to Cypress-supported majors.","Run `npm ls <pkg>` to detect duplicates after install.","Read Cypress release notes when upgrading bundler deps."],"tags":["webpack","version-mismatch","dependency-resolution","dev-server"],"backgroundTag":null,"analyzedSha":"0d85fdc91230885bca0a91df278312800a48b727","analyzedAt":"2026-08-12T16:24:28.056Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}