opencode icon indicating copy to clipboard operation
opencode copied to clipboard

error Window.getComputedStyle

Open seasidedog24 opened this issue 1 week ago • 1 comments

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

seasidedog24 avatar Jan 18 '26 08:01 seasidedog24

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

  • #8666: windows app 1.1.21 - Same exact error: 'Failed to execute getComputedStyle on Window: parameter 1 is not of type Element'
  • #9079: Critical Error when starting a new chat - Same error stack trace with identical getComputedStyle failure

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.

github-actions[bot] avatar Jan 18 '26 08:01 github-actions[bot]

Same problem

yewenbryan-dev avatar Jan 19 '26 11:01 yewenbryan-dev

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

Mrxuuuu avatar Jan 19 '26 11:01 Mrxuuuu