claude-code - 💡(How to fix) Fix [BUG] preview_start embedded browser rejects locally-trusted mkcert certificates [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#48757Fetched 2026-04-16 06:51:49
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1

Error Message

  1. Embedded Chromium rejects the cert — navigating via preview_eval with window.location.replace('https://...') lands on chrome-error://chromewebdata/

Fix Action

Workaround

Configure the dev server to serve HTTP when launched from preview_start, but this means HTTPS-dependent flows (like OAuth) can't be tested in a regular browser on the same server.

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

preview_start cannot load HTTPS dev servers that use locally-trusted certificates (e.g. from mkcert). Both the health check and the embedded Chromium browser reject the certificates, even though they are trusted by the host system's certificate store.

This forces workarounds like making the dev server serve HTTP instead, which breaks the ability to use the same server from a regular browser for OAuth flows that require HTTPS.

Steps to Reproduce

  1. Generate localhost certs with mkcert localhost and install the CA with mkcert -install
  2. Configure a dev server (e.g. Vite) to use these certs for HTTPS
  3. Set up .claude/launch.json with "url": "https://localhost:5100"
  4. Run preview_start

Expected Behavior

Preview browser trusts locally-installed CAs, page loads normally.

Actual Behavior

Two issues:

  1. Health check rejects the cert — "Awaiting server..." forever (likely Node.js-based, doesn't use system trust store)
  2. Embedded Chromium rejects the cert — navigating via preview_eval with window.location.replace('https://...') lands on chrome-error://chromewebdata/

Suggested Fix

  • Health check: respect NODE_EXTRA_CA_CERTS or read system trust store
  • Embedded Chromium: launch with --ignore-certificate-errors for localhost, or import system CA roots

Workaround

Configure the dev server to serve HTTP when launched from preview_start, but this means HTTPS-dependent flows (like OAuth) can't be tested in a regular browser on the same server.

Environment

  • OS: macOS 15.4
  • Claude Code: latest (Claude Desktop)
  • Cert tool: mkcert v1.4.4

extent analysis

TL;DR

The issue can be mitigated by configuring the health check to respect the system trust store or NODE_EXTRA_CA_CERTS and launching the embedded Chromium browser with --ignore-certificate-errors for localhost.

Guidance

  • Verify that the mkcert CA is installed and trusted by the host system's certificate store.
  • Consider setting the NODE_EXTRA_CA_CERTS environment variable to include the mkcert CA certificate.
  • To mitigate the issue with the embedded Chromium browser, explore launching it with the --ignore-certificate-errors flag for localhost URLs.
  • Review the launch.json configuration to ensure it is correctly set up to use the HTTPS URL with the locally-trusted certificate.

Example

No code snippet is provided as the issue is more related to configuration and environment setup.

Notes

The provided suggestions are based on the information given and might require further adjustments based on the specific setup and versions of the tools involved.

Recommendation

Apply the workaround by configuring the dev server to serve HTTP when launched from preview_start, but note that this will break HTTPS-dependent flows like OAuth. A more permanent solution would involve addressing the certificate trust issues directly.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] preview_start embedded browser rejects locally-trusted mkcert certificates [1 comments, 2 participants]