Skip to content

Unexpected error with message #4079

Closed
Closed

Description

@ValhallaAMB

Description

Unexpected renderer process error.

This error occurred in two cases:

I had 2 markdown files open in MarkText. I tried to switch between them an this error occurred.

Also, once I added the second markdown file, it had replaced the first markdown file. In other words, the contents of the second file were in the place of the first file. (I did not click save on the overiden rile so Idk if it actually replaced any of the actual content)

Extra info:

  1. I remapped the keybinding of switching between tabs to Alt+right to switch to the right tab and Alt+left to switch to the left tab.
  2. After I clicked the save on the new keybinding the error started to appear. Once I restarted the app, I wasn't able to replicate the error until I tried saving another keybinding.

Stack Trace

TypeError: Cannot read properties of null (reading 'parent')
    at Proxy.findOutMostBlock (file:///C:/Program%20Files/marktext/resources/app.asar/out/renderer/assets/index-DZlSoTZb.js:144764:42)
    at Proxy.setNextRenderRange (file:///C:/Program%20Files/marktext/resources/app.asar/out/renderer/assets/index-DZlSoTZb.js:144406:36)
    at Proxy.render (file:///C:/Program%20Files/marktext/resources/app.asar/out/renderer/assets/index-DZlSoTZb.js:144425:10)
    at Proxy.setMarkdown (file:///C:/Program%20Files/marktext/resources/app.asar/out/renderer/assets/index-DZlSoTZb.js:145943:23)
    at handleFileChange (file:///C:/Program%20Files/marktext/resources/app.asar/out/renderer/assets/index-DZlSoTZb.js:160241:25)
    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)
    at Proxy.CLOSE_TABS (file:///C:/Program%20Files/marktext/resources/app.asar/out/renderer/assets/index-DZlSoTZb.js:92140:21)
    at Proxy.wrappedAction (file:///C:/Program%20Files/marktext/resources/app.asar/out/renderer/assets/index-DZlSoTZb.js:13135:19)

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