Skip to content

error Window.getComputedStyle #9215

Closed
Closed

Description

@seasidedog24

Description

Technical Analysis

The stack trace points to a minified React/Floating UI update loop (autoUpdate or similar) or a layout measurement hook. The error Window.getComputedStyle requiring an Element instance suggests that a ref.current is null or undefined at the moment of measurement.

This likely happens when:

The Markdown parser enters an incomplete state (e.g., inline code start).
The React render cycle triggers.
A layout effect tries to measure the dimensions of the code block or surrounding text.
The DOM node for that segment is not yet available or is invalid due to the incomplete parsing.
Suggested Fixes

Guard getComputedStyle: Ensure the element is an instanceof Element before calling getComputedStyle.
Robust Markdown Rendering: Handle incremental Markdown parsing gracefully (e.g., treat unclosed backticks as plain text until closed) to prevent render-phase errors.
Error Boundary: Wrap the message list or Markdown renderer in an Error Boundary to catch component-level errors without crashing the entire application window.

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

macOS 26.2

Terminal

No response

Activity

  1. github-actions commented on Jan 18, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Both of these issues report the exact same TypeError with the same stack trace pattern, suggesting they're related to the same underlying problem in the layout measurement or Floating UI autoUpdate cycle.

    Feel free to ignore if your specific case has different reproduction steps.

  2. yewenbryan-dev commented on Jan 19, 2026

    @yewenbryan-dev

    Same problem

  3. Mrxuuuu commented on Jan 19, 2026

    @Mrxuuuu

    opencode windows Version: 1.1.25 i have Same problem
    when i use sisyphus plan mode

  4. DarickBrokaw commented on Jan 21, 2026

    @DarickBrokaw

    I'm still experiencing this error on Windows despite issue #9496 being marked as completed.

    Environment:

    • OS: Windows
    • OpenCode: Desktop app (Windows)
    • Version: v1.1.21-v1.1.25

    Error:

    TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.
    TypeError: parameter 1 is not of type 'Element'.
        at getComputedStyle$1 (http://tauri.localhost/assets/index-nOUlZVlP.js:1707:91066)
        at isOverflowElement (http://tauri.localhost/assets/index-nOUlZVlP.js:1707:89839)
        at getOverflowAncestors (http://tauri.localhost/assets/index-nOUlZVlP.js:1707:91733)
        at autoUpdate (http://tauri.localhost/assets/index-nOUlZVlP.js:1707:99252)
        at Object.fn (http://tauri.localhost/assets/index-nOUlZVlP.js:1707:105253)
        at runComputation (http://tauri.localhost/assets/index-nOUlZVlP.js:2:8250)
        at updateComputation (http://tauri.localhost/assets/index-nOUlZVlP.js:2:7981)
        at runTop (http://tauri.localhost/assets/index-nOUlZVlP.js:2:9466)
        at runUserEffects (http://tauri.localhost/assets/index-nOUlZVlP.js:2:10730)
        at http://tauri.localhost/assets/index-nOUlZVlP.js:2:10322
    

    Analysis:
    This is a Floating UI positioning library issue. The error occurs when:

    1. A floating element (dropdown/tooltip/suggestion box) tries to calculate its position
    2. The element hasn't been fully added to the DOM yet
    3. autoUpdate calls getComputedStyle on an undefined/null element reference

    Triggers:

    • Long input strings/prompts causing layout recalculation
    • May be related to 'Animate Items' settings
    • First message interaction often triggers it

    Workaround applied:
    Disabled auto-update in config to prevent version changes. Please re-open or address if this is still being tracked.

  5. github-actions commented on Mar 28, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions