{"record":{"id":"ee316d2d75b692c3","repo":"slidevjs/slidev","slug":"the-exporting-for-slidev-is-powered-by-playwright","errorCode":null,"errorMessage":"The exporting for Slidev is powered by Playwright, please install it via `npm i -D playwright-chromium`","messagePattern":"The exporting for Slidev is powered by Playwright, please install it via `npm i -D playwright-chromium`","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/slidev/node/commands/export.ts","lineNumber":664,"sourceCode":"    }\n    catch { }\n  }\n\n  // 3. resolve from global registry\n  const { resolveGlobal } = await import('resolve-global')\n  try {\n    const imported = await import(resolveGlobal('playwright-chromium'))\n    return imported.default ?? imported\n  }\n  catch { }\n\n  // 4. resolve from current @slidev/cli installation\n  try {\n    return await import('playwright-chromium')\n  }\n  catch { }\n\n  throw new Error('The exporting for Slidev is powered by Playwright, please install it via `npm i -D playwright-chromium`')\n}\n","sourceCodeStart":646,"sourceCodeEnd":666,"githubUrl":"https://github.com/slidevjs/slidev/blob/0d798ace5828966d9f77f62094d5f7a971ad98f7/packages/slidev/node/commands/export.ts#L646-L666","documentation":"Exporting (PDF/PNG/PPTX) and ogImage generation require playwright-chromium. Slidev tries four resolution paths (user root, workspace root, global registry via resolve-global, and the bundled @slidev/cli location); if all fail it throws.","triggerScenarios":"Running slidev export or slidev build (with ogImage auto-gen) in an environment where playwright-chromium is not installed in any of the four lookup locations.","commonSituations":"Fresh clone, CI without the optional dependency, monorepo where playwright lives in a different workspace, or a global install that resolve-global cannot find.","solutions":["Run `npm i -D playwright-chromium` in the project","Install playwright-chromium globally if shared across projects","Ensure the dependency is present in the same workspace that runs slidev"],"exampleFix":"// before\nslidev export  (fails)\n// after\nnpm i -D playwright-chromium\nslidev export","handlingStrategy":"validation","validationCode":"async function hasPlaywright(): Promise<boolean> {\n  try { await import('playwright-chromium'); return true } catch { return false }\n}\nif (!await hasPlaywright()) {\n  throw new Error('Run `npm i -D playwright-chromium` before exporting')\n}","typeGuard":null,"tryCatchPattern":"try {\n  const pw = await resolvePlaywright()\n} catch (e) {\n  console.error('Install playwright-chromium first: npm i -D playwright-chromium')\n  process.exit(1)\n}","preventionTips":["Add playwright-chromium to devDependencies in any project that exports slides","Verify the dependency in CI before running the export step"],"tags":["export","playwright","dependency"],"backgroundTag":null,"analyzedSha":"0d798ace5828966d9f77f62094d5f7a971ad98f7","analyzedAt":"2026-08-12T17:10:56.221Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}