Skip to content

Unexpected error with message Cannot read properties of null (reading 'getBoundingClientRect') #5352

Closed as duplicate

Description

Description

Unexpected renderer process error.

Minimal Reprouducible Markdown Example (or Steps)

Stack Trace

TypeError: Cannot read properties of null (reading 'getBoundingClientRect')
    at HTMLBodyElement._mouseMove (file:///Applications/marktext.app/Contents/Resources/app.asar/out/renderer/assets/index-D8_UerJB.js:154389:36)

Version

MarkText: v0.20.0-beta.5
Operating system: Darwin arm64 25.6.0 (darwin)

Activity

  1. Jocs commented on Sep 15, 2026

    @Jocs
    Member

    Thanks for the report. This crash happens when you drag an image resize handle and let go of the mouse button outside the MarkText window. The click that followed hid the handles, but the drag's mouse-move listener stayed attached, so every later mouse move over the window threw Cannot read properties of null (reading 'getBoundingClientRect') in _mouseMove.

    We reproduced it on v0.20.0-rc.1, which has the same resize-bar code as beta.5: click an image, drag the right handle past the window edge, release outside the window, then move the mouse back. It was fixed by #5288, which ends the drag whenever the handles are hidden. The fix shipped in v0.20.0-rc.2. On rc.2, rc.3 and develop the same steps (and variants such as deleting the image, switching tabs or toggling source mode mid-drag) produce no errors, and resizing still works.

    While checking this we found a different way into the same handler that still fails on rc.3: drag-selecting over document content that uses the class name bar (inline HTML, an HTML block, or a mermaid classDef bar). That one is fixed in #5382.

    Closing as a duplicate of #4976. Please update to the latest pre-release, and open a new issue with steps if you still see this error there.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions