vercel/next.js · error · Error

missing mkcert binary

Error message

missing mkcert binary

What it means

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.

Source

Thrown at packages/next/src/lib/mkcert.ts:104

        },
      })
    )

    await fs.promises.chmod(binaryPath, 0o755)

    return binaryPath
  } catch (err) {
    Log.error('Error downloading mkcert:', err)
  }
}

export async function createSelfSignedCertificate(
  host?: string,
  certDir: string = 'certificates'
): Promise<SelfSignedCertificate | undefined> {
  try {
    const binaryPath = await downloadBinary()
    if (!binaryPath) throw new Error('missing mkcert binary')

    const resolvedCertDir = path.resolve(process.cwd(), `./${certDir}`)

    await fs.promises.mkdir(resolvedCertDir, {
      recursive: true,
    })

    const keyPath = path.resolve(resolvedCertDir, 'localhost-key.pem')
    const certPath = path.resolve(resolvedCertDir, 'localhost.pem')

    if (fs.existsSync(keyPath) && fs.existsSync(certPath)) {
      const cert = new X509Certificate(fs.readFileSync(certPath))
      const key = fs.readFileSync(keyPath)

      if (
        cert.checkHost(host ?? 'localhost') &&
        cert.checkPrivateKey(createPrivateKey(key))
      ) {

View on GitHub (pinned to 0eb3775416)

Solutions

  1. Install mkcert (e.g. brew install mkcert) or let Next.js download it; verify the binary path.
Defensive patterns

Strategy: fallback

When it happens

Trigger: The mkcert binary is expected on disk but missing.

Common situations: A failed or partial mkcert download left the cache without the binary.


AI-assisted analysis of vercel/next.js@0eb3775416 (2026-08-19). Data as JSON: /api/errors/5ebfd3e874aecd89. Report an issue: GitHub.