Skip to content

[Bug]: Chat file mention insertion crashes with ProseMirror fragment error #490

Description

@m43i

Description

Selecting a file mention in the chat editor can trigger a frontend runtime exception during insertion. The error indicates that the fileMention node cannot be converted to a ProseMirror fragment, which suggests that multiple versions of prosemirror-model may be loaded in the application bundle.

Steps to Reproduce

  1. Open the chat interface.
  2. Trigger the file mention picker.
  3. Select a file mention from the suggestion list.
  4. Observe the runtime error during insertion.

Expected Behavior

The selected file mention should be inserted into the chat editor without crashing the page.

Actual Behavior

The frontend throws a Runtime RangeError:

Can not convert <fileMention, ""> to a Fragment (looks like multiple versions of prosemirror-model were loaded)

The stack trace points to:

  • components/chat/FileMentionNode.tsx:87
  • components/chat/FileMentionList.tsx:56
  • components/chat/FileMentionList.tsx:71
  • components/chat/FileMentionNode.tsx:118

Screenshots

Image

Environment

  • Component: Frontend
  • Framework: Next.js 16.2.7 with Turbopack
  • Browser: Not specified
  • OS: Not specified

Additional Context

The failure occurs while calling insertContentAt for a custom fileMention node. The dependency graph should be checked for duplicate prosemirror-model versions or incompatible editor-related package versions.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingfrontendneeds-triageMaintainer needs to evaluate this issue

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions