Skip to content

Unexpected error: Cannot destructure property 'pathname' of 'e.tabs[o]' as it is undefined. #3551

Closed

Description

@nav1ce

Description

An unexpected error occurred in the renderer process.

Stack Trace

TypeError: Cannot destructure property 'pathname' of 'e.tabs[o]' as it is undefined.
    at tabIdList (file:///tmp/.mount_marktenV0Qvn/resources/app.asar/dist/electron/webpack:/marktext/src/renderer/store/editor.js:255:27)
    at Array.forEach (<anonymous>)
    at Store.CLOSE_TABS (file:///tmp/.mount_marktenV0Qvn/resources/app.asar/dist/electron/webpack:/marktext/src/renderer/store/editor.js:251:10)
    at wrappedMutationHandler (/tmp/.mount_marktenV0Qvn/resources/app.asar/node_modules/vuex/dist/vuex.common.js:846:13)
    at commitIterator (/tmp/.mount_marktenV0Qvn/resources/app.asar/node_modules/vuex/dist/vuex.common.js:468:7)
    at Array.forEach (<anonymous>)
    at /tmp/.mount_marktenV0Qvn/resources/app.asar/node_modules/vuex/dist/vuex.common.js:467:11
    at Store._withCommit (/tmp/.mount_marktenV0Qvn/resources/app.asar/node_modules/vuex/dist/vuex.common.js:626:3)
    at Store.commit (/tmp/.mount_marktenV0Qvn/resources/app.asar/node_modules/vuex/dist/vuex.common.js:466:8)
    at boundCommit (/tmp/.mount_marktenV0Qvn/resources/app.asar/node_modules/vuex/dist/vuex.common.js:411:19)

Version

MarkText: v0.17.1 (N/A)
Operating system: Linux x64 5.15.0-57-generic (linux)

Activity

  1. added
    🐛 bug
    on May 13, 2026
  2. Jocs commented on May 23, 2026

    @Jocs
    Member

    Closing — this was fixed during the Vuex → Pinia migration.

    CLOSE_TABS now uses a nullish-coalescing fallback at src/renderer/src/store/editor.ts:1044:

    const closed = this.tabs[index]
    const { pathname } = closed ?? { pathname: '' }

    so a concurrent mutation that removes a tab between findIndex and the array access no longer crashes.

    If you still see this on a recent build, please reopen with the exact version and the multi-tab steps 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

    🐛 bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions