You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unexpected error with message Cannot use numerical key for object container #4827
Error: Cannot use numerical key for object container
at assert (file:///Applications/marktext.app/Contents/Resources/app.asar/out/renderer/assets/index-D8_UerJB.js:146249:24)
at insertChildMut (file:///Applications/marktext.app/Contents/Resources/app.asar/out/renderer/assets/index-D8_UerJB.js:146288:99)
at drop2 (file:///Applications/marktext.app/Contents/Resources/app.asar/out/renderer/assets/index-D8_UerJB.js:146393:127)
at drop2 (file:///Applications/marktext.app/Contents/Resources/app.asar/out/renderer/assets/index-D8_UerJB.js:146390:27)
at drop2 (file:///Applications/marktext.app/Contents/Resources/app.asar/out/renderer/assets/index-D8_UerJB.js:146390:27)
at Object.apply2 [as apply] (file:///Applications/marktext.app/Contents/Resources/app.asar/out/renderer/assets/index-D8_UerJB.js:146400:9)
at JSONState._apply (file:///Applications/marktext.app/Contents/Resources/app.asar/out/renderer/assets/index-D8_UerJB.js:147068:44)
at JSONState._flushOperationCache (file:///Applications/marktext.app/Contents/Resources/app.asar/out/renderer/assets/index-D8_UerJB.js:147221:10)
at file:///Applications/marktext.app/Contents/Resources/app.asar/out/renderer/assets/index-D8_UerJB.js:147201:12
Version
MarkText: v0.20.0-beta.5
Operating system: Darwin arm64 25.5.0 (darwin)
This crash happens in the deferred state-flush path (JSONState._flushOperationCache → _apply → ot-json1 apply → drop/insertChildMut). Muya batches the edit operations produced within one animation frame and compose()s them into a single op before applying it. The message Cannot use numerical key for object container is ot-json1 rejecting the composed op: one of its inserts targets a numeric index inside a block object (i.e. the coalesced operations disagreed about the document structure), so the op can't be applied to the document.
I tried hard to reproduce it on current develop (0.20.0-dev) — ~25 same-frame/coalesced editing scenarios through the deferred flush path: paragraph↔list/heading/blockquote/thematic-break conversions, multi-line and task-list conversions, back-to-back conversions, list merge/split/indent/outdent, and edit-after-convert. None reproduced this crash — the operation batches all composed and applied cleanly.
What I could not drive in a headless test is real IME composition, and that looks like the likely trigger here:
Given I can't reproduce it, I'm closing this for now — but it may be a genuine coalesced-op bug in the same area. If you can reproduce it, please reopen with:
your OS input method / language (e.g. Pinyin, Japanese, Korean), and
the exact keystrokes / text and the document context (were you inside a list, table, converting a line to a heading/list, etc.),
and we'll fix it. A build newer than beta.5 (with #4815/#4838) is also worth trying, in case it was the same IME null-op path surfacing differently.
Activity
Jocs commentedon Jul 4, 2026
Thanks for the report!
This crash happens in the deferred state-flush path (
JSONState._flushOperationCache→_apply→ot-json1apply →drop/insertChildMut). Muya batches the edit operations produced within one animation frame andcompose()s them into a single op before applying it. The messageCannot use numerical key for object containerisot-json1rejecting the composed op: one of its inserts targets a numeric index inside a block object (i.e. the coalesced operations disagreed about the document structure), so the op can't be applied to the document.I tried hard to reproduce it on current
develop(0.20.0-dev) — ~25 same-frame/coalesced editing scenarios through the deferred flush path: paragraph↔list/heading/blockquote/thematic-break conversions, multi-line and task-list conversions, back-to-back conversions, list merge/split/indent/outdent, and edit-after-convert. None reproduced this crash — the operation batches all composed and applied cleanly.What I could not drive in a headless test is real IME composition, and that looks like the likely trigger here:
History._recordreadinglengthofnull, same_flushOperationCachepath) come from CJK users on macOS.nullop that IME composition can produce during flush) and fix(muya): harden History against identity (null) json-change ops #4838 (hardenHistoryagainst it), both landed after the v0.20.0-beta.5 build you hit this on.Given I can't reproduce it, I'm closing this for now — but it may be a genuine coalesced-op bug in the same area. If you can reproduce it, please reopen with:
and we'll fix it. A build newer than beta.5 (with #4815/#4838) is also worth trying, in case it was the same IME null-op path surfacing differently.