{"record":{"id":"5ebfd3e874aecd89","repo":"vercel/next.js","slug":"missing-mkcert-binary","errorCode":null,"errorMessage":"missing mkcert binary","messagePattern":"missing mkcert binary","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/next/src/lib/mkcert.ts","lineNumber":104,"sourceCode":"        },\n      })\n    )\n\n    await fs.promises.chmod(binaryPath, 0o755)\n\n    return binaryPath\n  } catch (err) {\n    Log.error('Error downloading mkcert:', err)\n  }\n}\n\nexport async function createSelfSignedCertificate(\n  host?: string,\n  certDir: string = 'certificates'\n): Promise<SelfSignedCertificate | undefined> {\n  try {\n    const binaryPath = await downloadBinary()\n    if (!binaryPath) throw new Error('missing mkcert binary')\n\n    const resolvedCertDir = path.resolve(process.cwd(), `./${certDir}`)\n\n    await fs.promises.mkdir(resolvedCertDir, {\n      recursive: true,\n    })\n\n    const keyPath = path.resolve(resolvedCertDir, 'localhost-key.pem')\n    const certPath = path.resolve(resolvedCertDir, 'localhost.pem')\n\n    if (fs.existsSync(keyPath) && fs.existsSync(certPath)) {\n      const cert = new X509Certificate(fs.readFileSync(certPath))\n      const key = fs.readFileSync(keyPath)\n\n      if (\n        cert.checkHost(host ?? 'localhost') &&\n        cert.checkPrivateKey(createPrivateKey(key))\n      ) {","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/vercel/next.js/blob/0eb377541648e63402a47b38fee00a8d0ce8f8f1/packages/next/src/lib/mkcert.ts#L86-L122","documentation":"Post-download guard in createSelfSignedCertificate: downloadBinary caught and logged a download error, returning undefined, so there is no mkcert executable to run for generating the dev certificates. It is the user-visible consequence of an earlier swallowed network/platform failure.","triggerScenarios":"The mkcert binary is expected on disk but missing.","commonSituations":"A failed or partial mkcert download left the cache without the binary.","solutions":["Install mkcert (e.g. brew install mkcert) or let Next.js download it; verify the binary path."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0eb377541648e63402a47b38fee00a8d0ce8f8f1","analyzedAt":"2026-08-19T02:10:13.922Z","contentChangedAt":"2026-08-19T02:10:13.922Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}