{"record":{"id":"b664aad796f253af","repo":"slidevjs/slidev","slug":"slidev-theme-name-requires-slidev-version-r","errorCode":null,"errorMessage":"[slidev] theme \"${name}\" requires Slidev version range \"${engines.slidev}\" but found \"${version}\"","messagePattern":"\\[slidev\\] theme \"(.+?)\" requires Slidev version range \"(.+?)\" but found \"(.+?)\"","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/slidev/node/integrations/themes.ts","lineNumber":28,"sourceCode":"  'none': '',\n  'default': '@slidev/theme-default',\n  'seriph': '@slidev/theme-seriph',\n  'apple-basic': '@slidev/theme-apple-basic',\n  'shibainu': '@slidev/theme-shibainu',\n  'bricks': '@slidev/theme-bricks',\n}\n\nexport const resolveTheme = createResolver('theme', officialThemes)\n\nexport async function getThemeMeta(name: string, root: string) {\n  const path = join(root, 'package.json')\n  if (!existsSync(path))\n    return {}\n\n  const { slidev = {}, engines = {} } = JSON.parse(await fs.readFile(path, 'utf-8'))\n\n  if (engines.slidev && !satisfies(version, engines.slidev, { includePrerelease: true }))\n    throw new Error(`[slidev] theme \"${name}\" requires Slidev version range \"${engines.slidev}\" but found \"${version}\"`)\n\n  return slidev as SlidevThemeMeta\n}\n","sourceCodeStart":10,"sourceCodeEnd":32,"githubUrl":"https://github.com/slidevjs/slidev/blob/0d798ace5828966d9f77f62094d5f7a971ad98f7/packages/slidev/node/integrations/themes.ts#L10-L32","documentation":"Thrown by getThemeMeta when a Slidev theme's package.json declares an engines.slidev semver range that the currently running Slidev version does not satisfy. The check uses satisfies(version, engines.slidev, { includePrerelease: true }) and fires only when engines.slidev is present and non-empty. It protects against loading a theme built against an incompatible Slidev API.","triggerScenarios":"Calling getThemeMeta(name, root) where the theme's package.json contains an engines.slidev field and the running Slidev version falls outside that range. Typical with a theme authored for Slidev 0.4x loaded under Slidev 0.5x, or a new theme under an old Slidev install.","commonSituations":"Upgrading Slidev but not the theme (or vice versa); mixing a globally-installed Slidev with a project-local theme that pins a different range; CI using a locked older Slidev while the theme's latest release bumped its engines.slidev requirement.","solutions":["Upgrade Slidev in the project to a version inside the range printed in engines.slidev (e.g. npm i -D @slidev/cli@latest).","If you cannot upgrade Slidev, downgrade the theme to a release whose engines.slidev accepts your current version.","Verify the theme package.json engines.slidev value and your installed version with npm ls @slidev/cli, then align them.","For a local/private theme, relax or correct the engines.slidev range in its package.json to match the deployed Slidev."],"exampleFix":"// before: theme package.json\n{\n  \"name\": \"@my/slidev-theme\",\n  \"engines\": { \"slidev\": \">=0.48.0\" }\n}\n// running Slidev is 0.47.x -> throws\n\n// after: align either side\n// option A - upgrade Slidev\nnpm i -D @slidev/cli@latest\n// option B - widen theme range\n{\n  \"name\": \"@my/slidev-theme\",\n  \"engines\": { \"slidev\": \">=0.47.0\" }\n}","handlingStrategy":"validation","validationCode":"import { satisfies } from 'semver'\nimport { version as slidevVersion } from '@slidev/cli/package.json'\n\nfunction themeCompatible(engines: { slidev?: string } | undefined): boolean {\n  if (!engines?.slidev) return true\n  return satisfies(slidevVersion, engines.slidev, { includePrerelease: true })\n}\n\n// before applying a theme:\nconst themePkg = require.resolve('<theme>/package.json')\nif (!themeCompatible(require(themePkg).engines)) {\n  throw new Error('Theme incompatible; upgrade Slidev or the theme first.')\n}","typeGuard":"function hasEnginesSlidev(pkg: unknown): pkg is { engines: { slidev: string } } {\n  return !!pkg\n    && typeof pkg === 'object'\n    && !!(pkg as any).engines\n    && typeof (pkg as any).engines.slidev === 'string'\n}","tryCatchPattern":"try {\n  await getThemeMeta(themeName, themeRoot)\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('[slidev] theme ')) {\n    // surface a guided upgrade prompt to the user\n    throw new Error('Theme version mismatch. Upgrade @slidev/cli or pick another theme.')\n  }\n  throw e\n}","preventionTips":["Pin both @slidev/cli and theme versions in lockstep in package.json.","In CI, assert satisfies(cliVersion, themePkg.engines.slidev) before building.","After upgrading Slidev, re-resolve all themes and bump any that lag.","For private themes, set engines.slidev conservatively to the range you test against."],"tags":["theme","versioning","semver","configuration"],"backgroundTag":null,"analyzedSha":"0d798ace5828966d9f77f62094d5f7a971ad98f7","analyzedAt":"2026-08-12T17:10:56.221Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}