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
I ran an "update" (uv pip install --upgrade mkdocs-materialx) and it updated - pymdown-extensions==12.0.1 to + pymdown-extensions==12.1 and on restarting the server, got few hundred of these:
To fix it I just reverted the change back to "12.0.1"
Clarification on the root cause:
The mkdocs-markmap plugin isn't bundled directly into this (MaterialX) theme's core repository.
The error occurs for users who have installed mkdocs-markmap in their local setups alongside mkdocs-materialx. The mkdocs-markmap extension hooks into pymdownx.superfences, which breaks globally on every page when pymdown-extensions automatically updates to v12.1+ due to a required 4th positional argument (reset) missing from the plugin's code.
Leaving this note here for anyone else using this (MaterialX) theme boilerplate who hits the same server crash—pinning pymdown-extensions==12.0.1 locally safely bypasses the issue until the markmap plugin gets an update.
Root cause, more precisely: pymdown-extensions 12.1 changed SuperFencesCodeExtension.extend_super_fences() to require a 4th positional argument, reset (a callback for clearing any state a custom fence type holds between renders — 12.1 defaults to a no-op, default_reset, for its own built-in custom fences when nothing else is given). extension.py here only ever calls it with 3 arguments, which is what throws on 12.1+.
A version-tolerant fix, tested against both 12.0.1 and 12.1:
try:
frompymdownx.superfencesimportdefault_validator, fence_code_format, _formatter, _validatortry:
# pymdown-extensions 12.1+ requires a 4th 'reset' argumentfrompymdownx.superfencesimport_reset, default_resetextension.extend_super_fences(
"markmap",
partial(_formatter, class_name="language-markmap", _fmt=fence_code_format),
partial(_validator, validator=default_validator),
partial(_reset, _reset=default_reset)
)
exceptImportError:
# pymdown-extensions < 12.1 has no 'reset' argumentextension.extend_super_fences(
"markmap",
partial(_formatter, class_name="language-markmap", _fmt=fence_code_format),
partial(_validator, validator=default_validator)
)
breakexceptImportErrorase:
log.warning(f"markmap detected pymdownx.superfences, but import is not working: {e}")
This works on both 12.0.1 and 12.1+, so no pinning is needed once it's in.
Happy to open a PR if that's useful.
Activity
johnpiers commentedon Sep 25, 2026
Root cause, more precisely:
pymdown-extensions12.1 changedSuperFencesCodeExtension.extend_super_fences()to require a 4th positional argument,reset(a callback for clearing any state a custom fence type holds between renders — 12.1 defaults to a no-op,default_reset, for its own built-in custom fences when nothing else is given).extension.pyhere only ever calls it with 3 arguments, which is what throws on 12.1+.A version-tolerant fix, tested against both 12.0.1 and 12.1:
This works on both 12.0.1 and 12.1+, so no pinning is needed once it's in.
Happy to open a PR if that's useful.