claude-code - 💡(How to fix) Fix Flutter web apps don't render in Claude Preview (CanvasKit requires WebGL) [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#48124Fetched 2026-04-15 06:32:29
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1

Flutter web apps render as a black screen in the Claude Preview tool. The HTML and scripts load, but the Flutter engine never initializes — no flt-glass-pane, no canvas, no Flutter DOM elements appear. The same app works perfectly in a real Chrome browser.

Root Cause

Claude Preview uses Playwright's Chromium, which runs without GPU acceleration. Flutter's CanvasKit renderer compiles Skia to WASM and renders via WebGL. Without WebGL support, the engine silently fails to bootstrap.

As of Flutter 3.35, the --web-renderer html flag and HTML renderer have been removed — CanvasKit/Skwasm is the only option, making this a hard blocker with no workaround.

Fix Action

Workaround

Use the Chrome MCP (Claude in Chrome) to preview Flutter web apps in a real browser instead of Claude Preview.

Code Example

{
  "version": "0.0.1",
  "configurations": [
    {
      "name": "flutter-web",
      "runtimeExecutable": "cmd",
      "runtimeArgs": ["/c", "flutter", "run", "-d", "web-server", "--web-port", "3002", "--web-hostname", "localhost"],
      "port": 3002
    }
  ]
}
RAW_BUFFERClick to expand / collapse

Description

Flutter web apps render as a black screen in the Claude Preview tool. The HTML and scripts load, but the Flutter engine never initializes — no flt-glass-pane, no canvas, no Flutter DOM elements appear. The same app works perfectly in a real Chrome browser.

Root cause

Claude Preview uses Playwright's Chromium, which runs without GPU acceleration. Flutter's CanvasKit renderer compiles Skia to WASM and renders via WebGL. Without WebGL support, the engine silently fails to bootstrap.

As of Flutter 3.35, the --web-renderer html flag and HTML renderer have been removed — CanvasKit/Skwasm is the only option, making this a hard blocker with no workaround.

Steps to reproduce

  1. Create a Flutter web project
  2. Configure .claude/launch.json:
{
  "version": "0.0.1",
  "configurations": [
    {
      "name": "flutter-web",
      "runtimeExecutable": "cmd",
      "runtimeArgs": ["/c", "flutter", "run", "-d", "web-server", "--web-port", "3002", "--web-hostname", "localhost"],
      "port": 3002
    }
  ]
}
  1. Run preview_start — server starts, page loads, but screen is black
  2. preview_eval confirms: document.querySelector('flt-glass-pane') returns null
  3. Open localhost:3002 in real Chrome — works fine

Environment

  • Flutter 3.35.1 (stable)
  • Windows 11
  • Claude Code CLI

Possible solutions

  • Launch Playwright Chromium with --use-gl=egl or --use-gl=swiftshader flags to enable software WebGL
  • Expose a config option for custom Chromium launch flags
  • Document the limitation for Flutter users

Workaround

Use the Chrome MCP (Claude in Chrome) to preview Flutter web apps in a real browser instead of Claude Preview.

extent analysis

TL;DR

Enable software WebGL in Playwright Chromium to fix the black screen issue in Claude Preview for Flutter web apps.

Guidance

  • Launch Playwright Chromium with the --use-gl=egl or --use-gl=swiftshader flags to enable software WebGL, allowing CanvasKit to render correctly.
  • Consider exposing a config option for custom Chromium launch flags to make this workaround more accessible.
  • As a temporary workaround, use the Chrome MCP (Claude in Chrome) to preview Flutter web apps in a real browser instead of Claude Preview.
  • Verify that the flt-glass-pane element is present in the DOM after applying the workaround by running document.querySelector('flt-glass-pane') in the browser console.

Example

No code snippet is provided as the issue is related to configuration and launch flags.

Notes

The provided workaround may have performance implications due to the use of software WebGL. Additionally, this issue is specific to Flutter 3.35 and later, where the HTML renderer has been removed.

Recommendation

Apply the workaround by launching Playwright Chromium with the --use-gl=egl or --use-gl=swiftshader flags, as there is no fixed version available that addresses this issue. This allows developers to continue using Claude Preview for Flutter web app development.

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 Flutter web apps don't render in Claude Preview (CanvasKit requires WebGL) [1 comments, 2 participants]