{"record":{"id":"4af82f111ab5cb9c","repo":"vercel/next.js","slug":"certificate-files-not-found","errorCode":null,"errorMessage":"Certificate files not found","messagePattern":"Certificate files not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/next/src/lib/mkcert.ts","lineNumber":155,"sourceCode":"\n    const defaultHosts = ['localhost', '127.0.0.1', '::1']\n\n    const hosts =\n      host && !defaultHosts.includes(host)\n        ? [...defaultHosts, host]\n        : defaultHosts\n\n    execSync(\n      `\"${binaryPath}\" -install -key-file \"${keyPath}\" -cert-file \"${certPath}\" ${hosts.join(\n        ' '\n      )}`,\n      { stdio: 'ignore' }\n    )\n\n    const caLocation = execSync(`\"${binaryPath}\" -CAROOT`).toString().trim()\n\n    if (!fs.existsSync(keyPath) || !fs.existsSync(certPath)) {\n      throw new Error('Certificate files not found')\n    }\n\n    Log.info(`CA Root certificate created in ${caLocation}`)\n    Log.info(`Certificates created in ${resolvedCertDir}`)\n\n    const gitignorePath = path.resolve(process.cwd(), './.gitignore')\n\n    if (fs.existsSync(gitignorePath)) {\n      const gitignore = await fs.promises.readFile(gitignorePath, 'utf8')\n      if (!gitignore.includes(certDir)) {\n        Log.info('Adding certificates to .gitignore')\n\n        await fs.promises.appendFile(gitignorePath, `\\n${certDir}`)\n      }\n    }\n\n    return {\n      key: keyPath,","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/vercel/next.js/blob/0eb377541648e63402a47b38fee00a8d0ce8f8f1/packages/next/src/lib/mkcert.ts#L137-L173","documentation":"Post-run verification in createSelfSignedCertificate: mkcert was executed with -install and exited without error, but the expected key and/or certificate files were still not written to disk. The tool's exit status lied about success, so Next.js re-checks the filesystem before trusting the result.","triggerScenarios":"mkcert ran but the generated certificate files are not found.","commonSituations":"Certificate generation failed silently or files were written to an unexpected location.","solutions":["Re-run the certificate generation (next dev --experimental-https) so the cert files are created."],"exampleFix":null,"handlingStrategy":"validation","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-14T05:17:10.506Z"}