Skip to content

build fails with mkdocs-material > 9.0.6 #110

@boegel

Description

@boegel

We fixed the mkdocs-material version used to build the docs to 9.0.6 in d974bab (included via #109), to work around failing build with mkdocs-material==9.0.7 and mkdocs-material==9.0.8

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.10.9/x64/bin/mkdocs", line 8, in <module>
    sys.exit(cli())
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/mkdocs/__main__.py", line 250, in build_command
    build.build(cfg, dirty=not clean)
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/mkdocs/commands/build.py", line 320, in build
    _build_theme_template(template, env, files, config, nav)
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/mkdocs/commands/build.py", line 118, in _build_theme_template
    output = _build_template(template_name, template, files, config, nav)
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/mkdocs/commands/build.py", line 97, in _build_template
    output = template.render(context)
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/jinja2/environment.py", line 1301, in render
    self.environment.handle_exception()
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/material/404.html", line 4, in top-level template code
    {% extends "main.html" %}
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/material/main.html", line 4, in top-level template code
    {% extends "base.html" %}
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/material/base.html", line 148, in top-level template code
    {% block site_nav %}
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/material/base.html", line 156, in block 'site_nav'
    {% include "partials/nav.html" %}
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/material/partials/nav.html", line 27, in top-level template code
    {% include "partials/nav-item.html" %}
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/material/partials/nav-item.html", line 91, in top-level template code
    {{ render(nav_item, path, level) }}
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/jinja2/runtime.py", line 777, in _invoke
    rv = self._func(*arguments)
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/material/partials/nav-item.html", line 56, in template
    {{ render(nav_item, path ~ "_" ~ loop.index, level + 1) }}
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/jinja2/runtime.py", line 777, in _invoke
    rv = self._func(*arguments)
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/material/partials/nav-item.html", line 48, in template
    <nav class="md-nav" data-md-level="{{ level }}" aria-labelledby="{{ path }}_label" aria-expanded="{{ nav_item.active | tojson }}">
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/jinja2/filters.py", line 1688, in do_tojson
    return htmlsafe_json_dumps(value, dumps=dumps, **kwargs)
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/site-packages/jinja2/utils.py", line 658, in htmlsafe_json_dumps
    dumps(obj, **kwargs)
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/json/__init__.py", line 238, in dumps
    **kw).encode(obj)
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/json/encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/json/encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
  File "/opt/hostedtoolcache/Python/3.10.9/x64/lib/python3.10/json/encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type Undefined is not JSON serializable
Error: Process completed with exit code 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions