Skip to content

Unexpected error with message #4078

Closed
Closed

Description

@ValhallaAMB

Description

Unexpected renderer process error.

I was changing the header size of my text, from a smaller to bigger heading.

Extra info:

  • I remapped the headers keybindings. For example, Ctrl+num1, Ctrl+num2, etc.
  • The markdown files that I was working, were created using Microsoft Notepad and then opened in MarkText

Stack Trace

IndexSizeError: Failed to execute 'setStart' on 'Range': The offset 4294967294 is larger than the node's length (2).
    at Selection.select (file:///C:/Program%20Files/marktext/resources/app.asar/out/renderer/assets/index-DZlSoTZb.js:95834:12)
    at Selection.setCursorRange (file:///C:/Program%20Files/marktext/resources/app.asar/out/renderer/assets/index-DZlSoTZb.js:95969:10)
    at Proxy.setCursor (file:///C:/Program%20Files/marktext/resources/app.asar/out/renderer/assets/index-DZlSoTZb.js:144400:15)
    at Proxy.partialRender (file:///C:/Program%20Files/marktext/resources/app.asar/out/renderer/assets/index-DZlSoTZb.js:144461:12)
    at ContentState2.updateParagraph (file:///C:/Program%20Files/marktext/resources/app.asar/out/renderer/assets/index-DZlSoTZb.js:140618:12)
    at Proxy.updateParagraph (file:///C:/Program%20Files/marktext/resources/app.asar/out/renderer/assets/index-DZlSoTZb.js:145999:23)
    at handleEditParagraph (file:///C:/Program%20Files/marktext/resources/app.asar/out/renderer/assets/index-DZlSoTZb.js:160189:23)
    at file:///C:/Program%20Files/marktext/resources/app.asar/out/renderer/assets/index-DZlSoTZb.js:77139:7
    at Array.map (<anonymous>)
    at Object.emit (file:///C:/Program%20Files/marktext/resources/app.asar/out/renderer/assets/index-DZlSoTZb.js:77138:20)

Version

MarkText: v0.18.4
Operating system: Windows_NT x64 10.0.26200 (win32)

Activity

  1. added
    🐛 bug
    🐞 pri/critical
    on May 13, 2026
  2. Jocs commented on May 23, 2026

    @Jocs
    Member

    Closing — this was fixed during the electron-vite refactor (commit 85607dd).

    The guard at src/muya/lib/utils/importMarkdown.js:464-467 short-circuits when anchorBlock or focusBlock is null:

    if (!anchorBlock || !focusBlock) {
      console.warn('Can not find anchor block or focus block in getMuyaIndexCursor')
      return null
    }

    The destructuring statement that crashed in your stack trace can no longer execute with a null operand. General-editor regression coverage was also expanded in #4268.

    If you still hit this crash on a 0.18.5+ build, please reopen with the exact version and steps.

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

    🐛 bug🐞 pri/critical🔭 area/editor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions