Skip to content

fix: stub app.configureWebAuthn no-op to prevent launch crash (#128)#131

Merged
johnzfitch merged 1 commit into
masterfrom
claude/close-duplicate-prs-gMJxg
May 31, 2026
Merged

fix: stub app.configureWebAuthn no-op to prevent launch crash (#128)#131
johnzfitch merged 1 commit into
masterfrom
claude/close-duplicate-prs-gMJxg

Conversation

@johnzfitch

Copy link
Copy Markdown
Owner

Problem

Newer Claude Desktop asar versions call app.configureWebAuthn() during main-process init. Because we spoof process.platform === "darwin", this darwin-gated callsite fires on Linux — where Electron has no such method — and throws an uncaught TypeError, crashing the app before any window opens.

This is issue #128:

TypeError: gA.app.configureWebAuthn is not a function

The crash trace shows gA.app — the Electron app object, which is exactly what the existing _macOnlyAppMethods no-op loop in frame-fix-wrapper.js already handles for the Handoff / NSUserActivity methods (#104 / #106, same root cause).

Fix

One line: add 'configureWebAuthn' to that existing array. The loop's typeof _earlyApp[_m] !== 'function' guard means we only stub the method when it's genuinely absent, so a platform that ships a real implementation is never clobbered. WebAuthn (passkey / security-key) setup is macOS-only and was never going to function on Linux Electron, so a no-op is the truthful and correct stand-in — no security feature is being disabled.

Why this instead of #129 / #130

Both open PRs fix the same crash but do more than necessary:

This PR is the minimal change: one string in the existing guarded loop, no new files, no unverified version claims.

Testing

  • node --check stubs/frame-fix/frame-fix-wrapper.js — syntax OK
  • node --test tests/node/current-path/*.test.cjs488 pass, 0 fail

Closes #128.

https://claude.ai/code/session_01LxAaF3raqdkyZyTPHBG8f4


Generated by Claude Code

Newer Claude Desktop asar versions call app.configureWebAuthn() during
main-process init. We spoof process.platform=darwin, so this darwin-gated
callsite fires on Linux, where Electron has no such method -- it throws
TypeError and crashes the app before any window opens.

Add it to the existing _macOnlyAppMethods no-op loop alongside the
Handoff/NSUserActivity stubs (same root cause as #104/#106). The
typeof guard means we only fill the gap when the method is absent, so
a platform with a real implementation is never clobbered.

Closes #128. Supersedes the two-file approach in #129 and the COMPAT
version bump in #130; this is the minimal single-line fix.

https://claude.ai/code/session_01LxAaF3raqdkyZyTPHBG8f4
Copilot AI review requested due to automatic review settings May 31, 2026 03:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a Linux launch crash caused by newer Claude Desktop asar builds calling app.configureWebAuthn() while the wrapper spoofs process.platform as Darwin.

Changes:

  • Adds configureWebAuthn to the existing guarded list of macOS-only Electron app methods stubbed as no-ops when absent.
  • Documents why the stub is needed for the launch-crash scenario tracked in #128.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@johnzfitch johnzfitch merged commit 7ddc5d2 into master May 31, 2026
5 checks passed
@johnzfitch johnzfitch deleted the claude/close-duplicate-prs-gMJxg branch May 31, 2026 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash on launch: gA.app.configureWebAuthn is not a function (asar 1.8555.2)

3 participants