Skip to content

fix(desktop): apply getComputedStyle polyfill on all platforms - #9369

Merged
adamdotdevin merged 1 commit into
anomalyco:devfrom
Slone123c:fix/getcomputedstyle-all-platforms
Jan 19, 2026
Merged

adamdotdevin merged 1 commit into
anomalyco:devfrom
Slone123c:fix/getcomputedstyle-all-platforms

Conversation

@Slone123c

Copy link
Copy Markdown
Contributor

Floating UI can call getComputedStyle with non-elements (e.g., null refs, virtual elements) on all platforms, not just Windows. This removes the Windows-only condition so the safety wrapper works on macOS and Linux too.

Fixes TypeError: Argument 1 ('element') to Window.getComputedStyle must be an instance of Element

What does this PR do?

On MacOS, I got error with the following:

TypeError: Argument 1 ('element') to Window.getComputedStyle must be an instance of Element
getComputedStyle@[native code]
ku@tauri://localhost/assets/index-D9T6R7qf.js:1707:89841
ru@tauri://localhost/assets/index-D9T6R7qf.js:1707:91735
wN@tauri://localhost/assets/index-D9T6R7qf.js:1707:99254
@tauri://localhost/assets/index-D9T6R7qf.js:1707:105255
Cb@tauri://localhost/assets/index-D9T6R7qf.js:2:8252
$l@tauri://localhost/assets/index-D9T6R7qf.js:2:7983
Ld@tauri://localhost/assets/index-D9T6R7qf.js:2:9468
Qk@tauri://localhost/assets/index-D9T6R7qf.js:2:10732
yn@tauri://localhost/assets/index-D9T6R7qf.js:2:9656
Jk@tauri://localhost/assets/index-D9T6R7qf.js:2:10317
yn@tauri://localhost/assets/index-D9T6R7qf.js:2:9668
M@tauri://localhost/assets/index-D9T6R7qf.js:2:3736

Removes the if (isWindows) condition from the getComputedStyle polyfill in packages/desktop/src/index.tsx

Applies the safety wrapper on all platforms (macOS, Windows, Linux) instead of Windows only

How did you verify your code works?

Tested on local test cases. I can't reproduce this error on desktop version. It pop out sometimes when I continue on a conversation. But I am sure that this error occurs on MacOS.

Floating UI can call getComputedStyle with non-elements (e.g., null refs,
virtual elements) on all platforms, not just Windows. This removes the
Windows-only condition so the safety wrapper works on macOS and Linux too.

Fixes TypeError: Argument 1 ('element') to Window.getComputedStyle must be
an instance of Element
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

@adamdotdevin
adamdotdevin merged commit 13276ae into anomalyco:dev Jan 19, 2026
8 checks passed
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request May 5, 2026
AIALRA-0 pushed a commit to AIALRA-0/opencode-turn-engine that referenced this pull request Jun 10, 2026
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request Jun 14, 2026
meSingh pushed a commit to meSingh/opencode that referenced this pull request Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants