Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[insiders] AttributeError: 'TagsPlugin' object has no attribute 'tags_mapping' #3839

4 of 5 tasks
twardoch opened this issue Apr 24, 2022 · 3 comments
4 of 5 tasks


Copy link

@twardoch twardoch commented Apr 24, 2022

Contribution guidelines

I've found a bug and checked that ...

  • ... the problem doesn't occur with the mkdocs or readthedocs themes
  • ... the problem persists when all overrides are removed, i.e. custom_dir, extra_javascript and extra_css
  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem


When I build a doc where an .md contains:

  - importing
  - install


with mkdocs-material-8.2.10-insiders-4.13.0, I get a fail:

Traceback (most recent call last):
  File "/usr/local/Cellar/python@3.10/3.10.2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/Cellar/python@3.10/3.10.2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/", line 86, in _run_code
    exec(code, run_globals)
  File "/Users/adam/Library/Python/3.10/lib/python/site-packages/mkdocs/", line 236, in <module>
  File "/Users/adam/Library/Python/3.10/lib/python/site-packages/click/", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/Users/adam/Library/Python/3.10/lib/python/site-packages/click/", line 1053, in main
    rv = self.invoke(ctx)
  File "/Users/adam/Library/Python/3.10/lib/python/site-packages/click/", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/adam/Library/Python/3.10/lib/python/site-packages/click/", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/adam/Library/Python/3.10/lib/python/site-packages/click/", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/Users/adam/Library/Python/3.10/lib/python/site-packages/mkdocs/", line 192, in build_command**kwargs), dirty=not clean)
  File "/Users/adam/Library/Python/3.10/lib/python/site-packages/mkdocs/commands/", line 314, in build
    _build_page(, config, doc_files, nav, env, dirty)
  File "/Users/adam/Library/Python/3.10/lib/python/site-packages/mkdocs/commands/", line 212, in _build_page
    context = config['plugins'].run_event(
  File "/Users/adam/Library/Python/3.10/lib/python/site-packages/mkdocs/", line 102, in run_event
    result = method(item, **kwargs)
  File "/Users/adam/Library/Python/3.10/lib/python/site-packages/material/plugins/tags/", line 89, in on_page_context
    context["tags"] = [
  File "/Users/adam/Library/Python/3.10/lib/python/site-packages/material/plugins/tags/", line 90, in <listcomp>
  File "/Users/adam/Library/Python/3.10/lib/python/site-packages/material/plugins/tags/", line 126, in __render_tag
    type = self.tags_mapping.get(tag)
AttributeError: 'TagsPlugin' object has no attribute 'tags_mapping'

Upon looking at the source code of the newest tags/, it does look fishy. I can see how tags_mapping may not get assigned, but then the .get() method does not provide a fallback.

Expected behaviour

No fail when using the tags plugin

Actual behaviour

Fail in the newest mkdocs-material-8.2.10-insiders-4.13.0 (was OK in previous)

Steps to reproduce

Use the tags plugin with a simple .md file that contains some tags in the metadata

Package versions

  • Python 3.10.2
  • mkdocs, version 1.3.0
  • Material: Version: 8.2.10+insiders.4.13.0


  - search
  - monorepo
  - awesome-pages:
      filename: pages.yml
      collapse_single_pages: true
      strict: false
  - tags:

### System information

- Operating system: macOS 12.3
- Browser: Chrome
Copy link

@squidfunk squidfunk commented Apr 24, 2022

Thanks for reporting. I'm having a hard time reproducing this. Does this fix it?

pip install -e <path to insiders folder>

Copy link

@squidfunk squidfunk commented Apr 24, 2022

Ah, think I found the error. Fixed in master of Insiders, can you confirm?

Copy link

@squidfunk squidfunk commented Apr 25, 2022

I'm pretty confident this was fixed in the latest commit. I just released 8.2.11+insiders-4.13.1 which contains the fix. In case the issue persists, please reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

2 participants