Skip to content

Unexpected error: Failed to execute 'setStart' on 'Range': There is no child at offset 42. #4006

Closed

Description

@xiedians

Description

An unexpected error occurred in the renderer process.

Stack Trace

Error: Failed to execute 'setStart' on 'Range': There is no child at offset 42.
    at Object.select (file:///C:/Program%20Files/Marktext/resources/app.asar/dist/electron/renderer.js:2:160569)
    at Object.setCursorRange (file:///C:/Program%20Files/Marktext/resources/app.asar/dist/electron/renderer.js:2:162106)
    at Rs.setCursor (file:///C:/Program%20Files/Marktext/resources/app.asar/dist/electron/renderer.js:2:588619)
    at Rs.partialRender (file:///C:/Program%20Files/Marktext/resources/app.asar/dist/electron/renderer.js:2:589616)
    at file:///C:/Program%20Files/Marktext/resources/app.asar/dist/electron/renderer.js:2:567377

Version

MarkText: v0.17.1 (00f5061f)
Operating system: Windows_NT x64 10.0.26100 (win32)

Activity

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

    @Jocs
    Member

    Closing this with the regression-guard e2e specs added in #4268.

    The user-action recipe described here (and the same crash signature in ~25 other reports) does not reproduce on the current develop branch (0.18.9). The setCursorRange offset clamp at src/muya/lib/selection/index.js:524-530 plus cumulative refactor fixes appear to have closed the underlying bug.

    The recipes from these reports are now encoded as Playwright tests in test/e2e/crash-range-offset.spec.ts so a regression here will fail CI before it reaches another user.

    If you still hit this crash on a recent build, please reopen with the exact MarkText version and the markdown that triggered it.

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

    🐹 platform/windows🐛 bug🐞 pri/critical🔭 area/editor🔭 area/muya

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions