Skip to content

hideMenuIfNotFrozen throws "Cannot read properties of undefined (reading 'show') #2694

@shehabelhariry

Description

@shehabelhariry

Versions

  • @blocknote/core 0.49.0
  • @blocknote/react 0.49.0
  • @blocknote/mantine 0.49.0

What we see

After upgrading to 0.49, we started seeing a recurring TypeError in production from hideMenuIfNotFrozen. The throw happens inside a floating-ui scroll listener, so it lands on window.onerror rather than a React error boundary — the editor itself keeps working, but it's noisy in our error reporting.

Stack trace

TypeError: Cannot read properties of undefined (reading 'show')
    at hideMenuIfNotFrozen (packages/core/src/extensions/SideMenu/SideMenu.ts:788:44)
    at <floating-ui ancestorScroll callback> (packages/react/src/components/SideMenu/SideMenuController.tsx:49:50)

Reproduction

We see this in production from real users on normal hardware — no throttling involved. The steps below are just what we found works to trigger it locally.

  1. Render <BlockNoteView editor={editor} editable={editable} /> with some block content.
  2. Hover a block to surface the side menu.
  3. Toggle editable from truefalsetrue.
  4. Scroll the editor's container or an ancestor.

The window seems small — to reproduce reliably locally:

  • Throttle CPU 4–6× in Chrome DevTools (Performance tab → CPU), or
  • Use a long document with an active scroll in progress during the toggle, or
  • Repeat the toggle several times rapidly.

Reproduces consistently in our app at 6× CPU throttle.

What did you expect to happen?

No error thrown.

Steps to reproduce

  1. Render <BlockNoteView editor={editor} editable={editable} /> with some block content.
  2. Hover a block to surface the side menu.
  3. Toggle editable from truefalsetrue.
  4. Scroll the editor's container or an ancestor.

The window seems small — to reproduce reliably locally:

  • Throttle CPU 4–6× in Chrome DevTools (Performance tab → CPU), or
  • Use a long document with an active scroll in progress during the toggle, or
  • Repeat the toggle several times rapidly.

Reproduces consistently in our app at 6× CPU throttle.

BlockNote version

0.49.0

Environment

Chrome 147 on Windows (production reports). Reproduced locally on Chrome on macOS.

Additional context

No response

Contribution

  • I'd be interested in contributing a fix for this issue

Sponsor

  • I'm a sponsor and would appreciate if you could look into this sooner than later 💖

Metadata

Metadata

Assignees

Labels

needs-triageIssue has not yet been reviewed or classified by maintainers.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions