Repository navigation
fix: resolve macOS 12 window not showing (WebKit TLA bug) - #96
Merged
Merged
Conversation
…t bug
On macOS 12 (Monterey), the app launches but no main window appears.
The root cause is WebKit bug #242740: Safari 15's WKWebView has a race
condition with top-level await in ES modules, causing silent JS failure
that prevents `getCurrentWindow().show()` from ever being called.
Three complementary fixes:
1. Change Vite build target from `esnext` to `safari14` (Tauri recommended)
and add `vite-plugin-top-level-await` to transform TLA into compatible
Promise chains, avoiding the WebKit bug entirely.
2. Replace top-level `await import("./App")` in main.tsx with a `.then()`
chain, removing TLA dependency at the source level.
3. Add a Rust-side 8-second timeout safety net in `setup()` that
force-shows the main window if the frontend JS fails to do so,
preventing permanently hidden windows regardless of the failure cause.
Closes #95
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
zihenghe04
added a commit
to zihenghe04/claude-prism
that referenced
this pull request
Sep 17, 2026
…wing fix: resolve macOS 12 window not showing (WebKit TLA bug)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #95 — On macOS 12 (Monterey), ClaudePrism launches but no main window appears (
count windows = 0).Root cause: WebKit Bug #242740 — Safari 15's WKWebView has a race condition with top-level
awaitin ES modules, causing silent JS failure. Since the window starts withvisible: falseand relies on JS callinggetCurrentWindow().show(), the window stays permanently hidden.Changes
esnext→safari14(macOS) /chrome105(Windows), matching Tauri's recommended configvite-plugin-top-level-awaitto transform top-level await into Promise chains compatible with older WebKitawait import("./App")with.then()chain to eliminate TLA at source levelsetup()that force-shows the main window if JS never signals readinessReferences
Test plan
Cmd+N) still works🤖 Generated with Claude Code