buzz icon indicating copy to clipboard operation
buzz copied to clipboard

[Bug] Desktop v0.4.26 renders completely blank on macOS 12.7.6 arm64

Open marketreadyai opened this issue 4 months ago • 9 comments

Summary

The official Buzz Desktop v0.4.26 application opens as a completely blank full-size window on macOS 12.7.6 (Apple Silicon).

The native application starts, but the frontend never commits its initial render.

Environment

  • macOS: 12.7.6
  • Build: 21H1320
  • Architecture: arm64
  • Safari: 17.6
  • Buzz: 0.4.26
  • Bundle ID: xyz.block.buzz.app
  • Executable architecture: arm64
  • Installation: official notarised DMG
  • Gatekeeper: accepted
  • Code signature: valid
  • Declared minimum macOS version: 10.15

Steps to reproduce

  1. Install the official Buzz Desktop v0.4.26 arm64 DMG.
  2. Open Buzz.
  3. Observe that the entire application window is blank.

I also reproduced it after:

  • quitting Buzz;
  • confirming nothing was listening on port 3000;
  • backing up/removing Application Support, WebKit, cache, preferences and saved-window state;
  • relaunching Buzz with clean first-run state.

Expected result

Buzz displays its welcome/onboarding interface.

Actual result

The entire application window is blank. There are no visible controls, messages or onboarding UI.

Native startup output

buzz-mesh: installed tokio runtime with 8 MiB worker stacks buzz-desktop: persisted identity pubkey [public key omitted] buzz-desktop: repos dir resolved at boot — no configured override, REPOS is the default real dir buzz-desktop: media proxy listening on 127.0.0.1:[dynamic port] buzz-desktop: initial render did not commit before reveal timeout

Additional diagnostic information

  • The native Buzz process remains running.
  • com.apple.WebKit.WebContent starts.
  • No application-level JavaScript exception appears in macOS unified logs.
  • The issue persists with port 3000 free.
  • On the first launch, another local Node application occupied port 3000, which caused a separate "relay returned an unexpected HTML page" message. Removing that conflict did not fix the blank renderer.
  • Docker is unavailable on this Mac, but this report concerns the packaged desktop application's onboarding renderer, before any self-hosted relay setup.

I can provide the filtered macOS WebKit log and a screenshot of the completely blank window if useful.

Image

marketreadyai avatar Jul 28 '26 11:07 marketreadyai

I hit this too, tracked down the root cause, and have it rendering. It isn't the GPU or the rendering pipeline — the frontend module graph fails to parse, so React never mounts and the window is revealed empty.

Same symptom on Intel: macOS 12.7.6 (21H1320), x86_64, built from source at main (relay 0.2.0 / desktop 0.5.2), identical initial render did not commit before reveal timeout. So this is macOS 12, not arm64-specific.

Root cause

On macOS 12 the system WKWebView is WebKit 613 (Safari 15.6-era):

/System/Library/Frameworks/WebKit.framework → 17613.3.9.1.16
navigator.userAgent (inside the webview) → AppleWebKit/605.1.15

Safari.app reporting 17.6 is a red herring — third-party apps get the system WebKit framework, not Safari's own. That's why looking for a modern-engine bug leads nowhere.

The boot graph uses two features that shipped in Safari 16.4. Both are parse-time SyntaxErrors, so they take down the whole importing chain.

Why it's invisible: the error event WebKit dispatches for a failed module script carries no message, filename, or line, and nothing appears in unified logs. import(), however, rejects with a real Error. Loading the dev server in a system WKWebView and importing the chain module-by-module gives:

src/main.tsx                              SyntaxError: Invalid regular expression: invalid group specifier name
src/app/App.tsx                           SyntaxError: Invalid regular expression: invalid group specifier name
src/app/AppShell.tsx                      SyntaxError: Unexpected token '{'
src/features/settings/ui/SettingsPanels.tsx   SyntaxError: Unexpected token '{'

1. RegExp lookbehind — invalid group specifier name is WebKit 613's message for (?<= / (?<!.

desktop/src/features/settings/ui/KeyboardShortcutsCard.tsx:13:

.split(/(?<!\+)\+(?!\s*$)/)

This sits in the boot graph: AppShell → SettingsPanels → KeyboardShortcutsCard. AppShell imports DEFAULT_SETTINGS_SECTION / isSettingsSection as values, so it's a runtime edge, not a type-only one.

2. Class static blocks — @radix-ui/[email protected]/dist/index.mjs:86 ships one in its published output:

var OrderedDict = class _OrderedDict extends Map {
  static {
    __name(this, "OrderedDict");
  }

Fix (verified working)

Two changes, and both are required:

1. Give Vite a target. There's currently no target in desktop/vite.config.ts, so the dependency graph is passed through as esnext.

⚠️ Vite 8 transforms with Rolldown/oxc, not esbuild — setting esbuild.target is silently ignored. My first attempt did exactly that and Vite logged:

Both esbuild and oxc options were set. oxc options will be used and esbuild
options will be ignored. The following esbuild options were set: `{ target: 'safari15' }`

optimizeDeps.esbuildOptions is also deprecated in favour of rolldownOptions. What actually works:

oxc: { target: "safari15" },
build: { target: "safari15" },
optimizeDeps: {
  rolldownOptions: { transform: { target: "safari15" } },
},

(Clear node_modules/.vite afterwards so deps re-optimize.) This fixes the class static blocks.

2. Remove the lookbehind from first-party source. This one cannot be transpiled — no build target rewrites a regex — so it has to come out of the source. Replacing the split in KeyboardShortcutsCard.tsx with an equivalent scan is enough; I verified the replacement is behaviorally identical across ⌘+Shift+K, ⌘+, ⌘++, Shift++, ⌘+K+, +, and empty input.

With both applied, all four modules parse, React mounts and commits, and the app boots to the onboarding screen on macOS 12.7.6 / x86_64.

Still broken on macOS 12 after the fix

desktop/src/features/messages/lib/mentionHighlightExtension.ts:110,125 build lookbehind via new RegExp(...). Those parse fine, so they don't block boot, but they will throw at runtime when rendering any message containing an @mention or #channel. Not a blocker for launching, but message rendering won't survive it.

(remark-gfm and shiki also contain lookbehind. shiki's are in lazily-loaded grammars, and remark-gfm turned out not to be on the eager boot path, so neither blocks startup.)

Suggestions

  • Decide the floor explicitly. There's no minimumSystemVersion in tauri.conf.json and no stated macOS requirement in the README, so macOS 12 users install the notarized DMG and get a black window with no explanation. Setting it would at least produce a clear OS-requirement message at launch.
  • If macOS 12 is meant to be supported, the Vite target plus a lint rule banning lookbehind in desktop/src would keep it from regressing — CI on Apple Silicon cannot catch this class of bug, since a modern WebKit parses it happily.
  • Make the failure visible. The initial render did not commit before reveal timeout path reveals an empty window. Surfacing an error there instead would turn "black screen, no logs" into something self-diagnosable. (Worth noting the deadline is 5s, which a cold dev start on slower hardware can miss even when everything is fine — it fires benignly for me now that the app works.)

Reproducing the real error on any machine

The trick is that window.onerror gives you nothing for module parse failures, but import() rejects with the real Error:

import("http://localhost:<vite-port>/src/main.tsx")
  .catch(e => console.log(e.name + ": " + e.message));

Run that inside a WKWebView on the target OS — a ~60-line Swift harness with a WKUserContentController message handler is enough — and the SyntaxError plus its message come straight out.

claytonwinterbotham avatar Jul 30 '26 04:07 claytonwinterbotham

Confirming this on Intel, and on the shipped release DMG rather than a source build — so it's not specific to arm64 or to building from main.

  • Hardware: MacBookPro13,2 (13-inch, 2016), Dual-Core Intel Core i7, x86_64
  • OS: macOS 12.7.6 (21H1320)
  • Buzz: v0.5.2, installed from the notarized Buzz_0.5.2_x64.dmg — no local build involved

Identical failure. The Rust side comes up fine and then the window is revealed empty:

buzz-desktop: persisted identity pubkey <redacted>
buzz-desktop: media proxy listening on 127.0.0.1:50233
buzz-desktop: repos dir resolved at boot — no configured override, REPOS is the default real dir
buzz-desktop: initial render did not commit before reveal timeout

Worth noting for anyone triaging by symptom: the window is not missing or mispositioned. CGWindowListCopyWindowInfo reports it as on-screen and fully opaque — it just paints nothing:

window #867 owner=Buzz pid=50047
  layer: 0   alpha: 1.0   onscreen: true
  bounds: x=640 y=314 w=800 h=525   (screen is 1440x900)

I can also confirm @claytonwinterbotham's engine diagnosis independently. On this machine:

  • Safari.app → 17.6, staged WebKit → 17618
  • but buzz-desktop links /System/Library/Frameworks/WebKit.framework (current version 624.2.5), and its WebContent process spawns from /System/Library/Frameworks/... — not the staged Safari framework other apps on the same machine get
  • system JavaScriptCore → 17613

Running both features through a real WKWebView on this OS, with a control to prove the harness works:

userAgent:       Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko)
lookbehind:      FAILS -> SyntaxError: Invalid regular expression: invalid group specifier name
static block:    FAILS -> SyntaxError: Unexpected token '{'
structuredClone: present (control)
Swift harness used (runs with swift probe.swift, no Xcode project needed)
import AppKit
import WebKit

let app = NSApplication.shared
let wv = WKWebView(frame: .zero)

let probe = """
(function () {
  var out = [];
  out.push("userAgent: " + navigator.userAgent);
  try { new RegExp("(?<!\\\\+)\\\\+"); out.push("lookbehind:    SUPPORTED"); }
  catch (e) { out.push("lookbehind:    FAILS -> " + e.name + ": " + e.message); }
  try { eval("class A { static { this.x = 1 } }"); out.push("static block:  SUPPORTED"); }
  catch (e) { out.push("static block:  FAILS -> " + e.name + ": " + e.message); }
  try { eval("structuredClone"); out.push("structuredClone: present (control)"); }
  catch (e) { out.push("structuredClone: FAILS (control) -> " + e.message); }
  return out.join("\\n");
})()
"""

wv.loadHTMLString("<html><body>probe</body></html>", baseURL: nil)
DispatchQueue.main.asyncAfter(deadline: .now() + 1.5) {
    wv.evaluateJavaScript(probe) { result, _ in
        if let s = result as? String { print(s) }
        exit(0)
    }
}
app.run()

Both offending lines are still present on main as of today:

  • desktop/src/features/settings/ui/KeyboardShortcutsCard.tsx:13 — .split(/(?<!\+)\+(?!\s*$)/)
  • desktop/vite.config.ts — no browser target set (the only target: in the file is target: "react" on the tanstackRouter plugin, which is unrelated)

Since this Mac is a 2016 model, Monterey is the last macOS it supports, so "upgrade the OS" isn't available as a workaround here — macOS 12 is the floor or nothing.

Happy to test a patched build on Intel/macOS 12 if that's useful for whoever picks this up.

jinji-pash avatar Jul 30 '26 15:07 jinji-pash

Confirming this on Intel, and on the shipped release DMG rather than a source build — so it's not specific to arm64 or to building from main.

  • Hardware: MacBookPro13,2 (13-inch, 2016), Dual-Core Intel Core i7, x86_64
  • OS: macOS 12.7.6 (21H1320)
  • Buzz: v0.5.2, installed from the notarized Buzz_0.5.2_x64.dmg — no local build involved

I can confirm that on

Hardware: MacBook Air 2015, 8 GB RAM, x86_64 OS: macOS 12.7.6 (21H1320) Buzz: v0.5.3, installed from the notarized Buzz_0.5.3_x64.dmg — no local build involved

Image

Works only close window, open buzz and quit.

Aladincz avatar Aug 01 '26 15:08 Aladincz

Another confirmation on v0.5.3 from the notarized Buzz_0.5.3_x64.dmg, no local build:

  • Hardware: MacBook Pro (Early 2015, 13"), Intel Core i5-5257U, 8 GB
  • OS: macOS 12.7.6 (21H1320), x86_64
  • Identical startup output, including initial render did not commit before reveal timeout.

Two additions that may help triage:

1. Only the frontend is affected. The CLI binaries shipped inside the app bundle work fine on this machine — Buzz.app/Contents/MacOS/buzz-acp --help runs and prints its options normally. So the Rust side is entirely healthy on macOS 12; the failure is confined to the WKWebView module graph, exactly as @claytonwinterbotham diagnosed.

2. An identity is created that the user cannot reach. On first launch the app persists an identity keypair (persisted identity pubkey …) before the renderer fails. Since onboarding never appears, there is no way to view or back up the secret key. Anyone who eventually gets the app running may want to check whether that first key is still the active one, and whether a backup prompt is ever shown for it.

Happy to test a build with the safari15 target and the lookbehind removal if that would be useful.

snoopy1810 avatar Aug 03 '26 04:08 snoopy1810

Confirming the same blank-window failure on Intel + Monterey 12.7.6 Same exact symptom and log as reported here. Hardware / OS

MacBook Pro (Retina, 13-inch, Early 2015) 2.7 GHz Dual-Core Intel Core i5 8 GB 1867 MHz DDR3 Intel Iris Graphics 6100 macOS Monterey 12.7.6 (21H1320) Buzz Desktop 0.5.3 (Buzz_0.5.3_x64.dmg)

Launch log textbuzz-desktop: persisted identity pubkey 45daa4f9176652c91e87c6098672a4966989d8f6e166b83f720e463391a768ff buzz-desktop: repos dir resolved at boot — no configured override, REPOS is the default real dir buzz-desktop: media proxy listening on 127.0.0.1:59171 buzz-desktop: initial render did not commit before reveal timeout Window opens full-screen dark/blank with zero interactivity. Matches the WebKit 613 (Safari 15.6-era) parse failures already diagnosed in this thread (lookbehind + static class blocks). Happy to test a patched build if one becomes available. Thanks for the detailed root-cause analysis!

fortblocks avatar Aug 03 '26 12:08 fortblocks

Confirming this is still reproducible with the current official Intel macOS build:

  • MacBook Pro 2016
  • macOS 12.7.6
  • Intel x86_64
  • Buzz Desktop v0.5.5
  • Installed from the official Buzz_0.5.5_x64.dmg
  • Result: Buzz opens to a completely blank window, matching the behavior described in this issue.

We'd really like to keep using Buzz on older Intel Macs too 🙂. Hopefully macOS 12 support can either be restored or the minimum supported macOS version can be made explicit in the release.

jhw367 avatar Aug 07 '26 18:08 jhw367

Confirming @claytonwinterbotham's diagnosis and fix work — built from main with the vite.config.ts safari15 target + the KeyboardShortcutsCard.tsx lookbehind removed, on a 2014 MacBook Pro (macOS 12.7.6, x86_64). App boots and reaches onboarding.

But there's a second lookbehind crash right after boot, once you actually view a channel with messages: Invalid regular expression: invalid group specifier name, thrown via the app's error boundary (no console output — same "invisible failure" pattern as the boot-time one, since WebKit gives no message/filename for these).

This one isn't in Buzz's own source — it's in the mdast-util-gfm-autolink-literal dependency (pulled in via remark-gfm, used by the message renderer for GFM autolinking):

node_modules/mdast-util-gfm-autolink-literal/lib/index.js:135
[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu, findEmail]

Since it's a regex literal (not new RegExp(string)), it throws the moment the module evaluates — i.e. the first time any message goes through the autolink pass. That's every channel view, not just messages containing @mentions/#channels — so this one's unavoidable, not opt-in.

Fix is a one-line removal, no behavior change: the findEmail handler right below it already re-implements the identical boundary check in plain JS via previous(match, true) (same pattern the URL regex two lines above already uses — that one has never had a lookbehind and relies solely on its own previous(match) call):

- [/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu, findEmail]
+ [/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu, findEmail]

Patched directly in node_modules for a local build (not upstream in mdast-util-gfm-autolink-literal — that'd need a separate PR/patch-package entry there, since this repo doesn't vendor it). With this + the two fixes already in this thread, the app is fully usable on macOS 12.7.6 Intel: onboarding, identity creation, and channel messages all render correctly.

Diagnosed by watching the Web Inspector console live through a key-import → channel-view repro, then confirming via the app's dist/assets/*.js build output which chunk actually threw (its own error boundary UI surfaced the message but not a stack trace).

EveryOddPixel avatar Aug 08 '26 18:08 EveryOddPixel

Still reproducible on the current release, and all three causes are unchanged in the shipped build.

Environment

  • MacBook, Intel x86_64
  • macOS 12.7.6 (21H1320)
  • Buzz Desktop 0.5.20, installed from the official Buzz 0.5.20.dmg, no local build
  • Result: no window at all

The last confirmation here against a release DMG was v0.5.5 (7 Aug). Eleven releases have shipped since.

Verified against the release tag desktop-v0.5.20, not main:

  1. The lookbehind is unchanged, at desktop/src/features/settings/ui/KeyboardShortcutsCard.tsx:17:

    .split(/(?<!\+)\+(?!\s*$)/)
    
  2. desktop/vite.config.ts still declares no browser target. Worth flagging for anyone skimming the file: it does contain a target, but it is target: "react" under the JSX options, unrelated to the transform target and easy to misread as the fix already being in place.

  3. @EveryOddPixel's third one is still shipped as well. pnpm-lock.yaml pins [email protected] (via [email protected]) and @radix-ui/[email protected], the exact versions named earlier in this thread.

On (3): the repo already carries a pnpm patches/ directory (isomorphic-git.patch, [email protected]), so that one-line removal can ship here as patches/[email protected]. It does not have to wait on an upstream PR.

Also still true: there is no minimumSystemVersion in desktop/src-tauri/tauri.conf.json, so the notarized DMG installs cleanly on macOS 12 and gives no indication of why the window is empty.

aurelie-brebant avatar Aug 28 '26 11:08 aurelie-brebant

Follow-up to my comment above: #5547 is open and already implements all of this, including the patches/[email protected] route I suggested. It has been waiting on review since 19 Aug. Worth converging there rather than adding further confirmations here.

Two things to add to what I posted:

  • I listed three causes, but there is a fourth in first-party source that I missed and that #5547 already covers: desktop/src/features/messages/lib/mentionHighlightExtension.ts:488 and :503, the patterns @claytonwinterbotham flagged at 110/125 before they moved. A full scan of desktop/src at desktop-v0.5.20 returns exactly three lookbehind hits: those two plus KeyboardShortcutsCard.tsx:17. Nothing else has crept in.
  • @radix-ui/[email protected] needs no patch entry of its own. Its static {} block is lowerable, so the build target in #5547 covers it. Only the lookbehinds resist transpilation, which is why mdast-util-gfm-autolink-literal is the one dependency that still needs a patch file.

Details, plus a WKWebView measurement against 0.5.20 and a note on what [email protected] actually defaults build.target to, are in the #5547 thread.

aurelie-brebant avatar Aug 28 '26 16:08 aurelie-brebant