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
[Bug] Keyboard selection of code language causes renderer crash (TypeError: Cannot read properties of null (reading 'functionType')) #4896
When creating a fenced code block using the keyboard, selecting the language from the autocomplete popup with the keyboard causes the renderer to crash.
Selecting the same language with the mouse works correctly.
Steps to Reproduce
Steps to reproduce
Create a new Markdown document.
Type: ```python
The language autocomplete appears.
Use the Down Arrow to highlight Python.
Press Enter.
Expected Behavior
Python is selected.
Cursor moves into the code block ready for typing.
Keyboard navigation consistently reproduces the error.
Note: This appears to affect keyboard-only editing workflows, since the mouse path succeeds while the keyboard path consistently crashes.
Error code generated in application:
Unexpected renderer process error TypeError: Cannot read properties of null (reading 'functionType') at ContentState2.updateCodeLanguage (file:///app/marktext/resources/app.asar/out/renderer/assets/index-ClkWA0Ji.js:131905:16) at ContentState2.selectLanguage (file:///app/marktext/resources/app.asar/out/renderer/assets/index-ClkWA0Ji.js:131894:10) at cb (file:///app/marktext/resources/app.asar/out/renderer/assets/index-ClkWA0Ji.js:143790:26) at CodePicker.selectItem (file:///app/marktext/resources/app.asar/out/renderer/assets/index-ClkWA0Ji.js:147536:5) at HTMLDivElement.handler (file:///app/marktext/resources/app.asar/out/renderer/assets/index-ClkWA0Ji.js:147501:16)
Operating System
Linux (Flatpak)
MarkText Version
v0.19.0
OS Version
MX Linux Fluxbox 21: Debian GNU/Linux 11 (bullseye)
This crash comes from the legacy editor engine that shipped with MarkText v0.19.x: TypeError: Cannot read properties of null (reading 'functionType') in ContentState.updateCodeLanguage. It is the same crash as #4620.
MarkText 0.20 replaced that engine with a rewritten one (@muyajs/core), so this code path no longer exists on develop or in v0.20.0-rc.1.
I also followed your steps on the current develop engine in a real browser. Typing ```python, moving through the language list with the arrow keys (or Tab) and pressing Enter creates a code block in the highlighted language with the cursor inside it, and there is no error. Pressing Enter right away, or clicking an item with the mouse, works the same way.
Closing as a duplicate of #4620. If you still see a crash on v0.20.0-rc.1 or newer, please open a new issue with the steps.
Activity
Jocs commentedon Sep 11, 2026
Thanks for the detailed report!
This crash comes from the legacy editor engine that shipped with MarkText v0.19.x:
TypeError: Cannot read properties of null (reading 'functionType')inContentState.updateCodeLanguage. It is the same crash as #4620.MarkText 0.20 replaced that engine with a rewritten one (
@muyajs/core), so this code path no longer exists ondevelopor in v0.20.0-rc.1.I also followed your steps on the current
developengine in a real browser. Typing```python, moving through the language list with the arrow keys (or Tab) and pressing Enter creates a code block in the highlighted language with the cursor inside it, and there is no error. Pressing Enter right away, or clicking an item with the mouse, works the same way.Closing as a duplicate of #4620. If you still see a crash on v0.20.0-rc.1 or newer, please open a new issue with the steps.