question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

UndefinedError: 'dict object' has no attribute 'toggle'

See original GitHub issue
  • I’ve read the [contribution guidelines][1] and agree with them

I’ve found a bug and checked that …

  • … the problem doesn’t occur with the default MkDocs template
  • … the problem is not in any of my customizations (CSS, JS, template)
  • … the documentation does not mention anything about my problem
  • … there are no open or closed issues that are related to my problem

Description

Since the latest release 7.1.0 an error occurred building a site while including the material/partials/header.html file

Expected behavior

Build should not fail with an error

Actual behavior

File “/venv/lib/python3.9/site-packages/material/main.html”, line 4, in top-level template code {% extends “base.html” %} File “/venv/lib/python3.9/site-packages/material/base.html”, line 118, in top-level template code {% block header %} File “/venv/lib/python3.9/site-packages/material/base.html”, line 119, in block “header” {% include “partials/header.html” %} File “/venv/lib/python3.9/site-packages/material/partials/header.html”, line 36, in top-level template code <label class="md-header__button md-icon" title="{{ option.toggle.name }}" for="__palette_{{ loop.index0 or loop.length }}" hidden> File “/venv/lib/python3.9/site-packages/jinja2/environment.py”, line 471, in getattr return getattr(obj, attribute)

Steps to reproduce the bug

  1. Update any sample to the latest release 7.1.0
  2. run mkdocs build

Package versions

  • Python: Python 3.9.2
  • MkDocs: mkdocs, version 1.1.2
  • Material: Version: 7.1.0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
thebinocommented, Mar 30, 2021

Thanks @julian-alarcon Exactly what described solved the issue here as well.

old configuration

  name: material
  custom_dir: overrides

  palette:
    - scheme: preference
      primary: blue
      accent: pink

new configuration

theme:
  name: material
  custom_dir: overrides

  palette:
    scheme: preference
    primary: blue
    accent: pink
0reactions
squidfunkcommented, Mar 29, 2021

Ok thanks, that syntax was never officially supported. It makes no sense to use the list syntax without defining the toggles. Thus, it’s a configuration error 😊

Read more comments on GitHub >

github_iconTop Results From Across the Web

UndefinedError: 'dict object' has no attribute 'payload_json' ...
Okay, this was user error. I was attempting to run the Automations manually. Restarting Home Assistant solved the issue and my Shellies started ......
Read more >
Error rendering data template: UndefinedError: 'dict object ...
and I receive the following error when I run/test the automation. Error: Error rendering data template: UndefinedError: 'dict object' has no ...
Read more >
jinja2.exceptions.UndefinedError: 'dict object' has no ...
Seems the inner dictionary inside the Jinja object is not being parsed correctly, but I cannot reproduce your bug on my computer.
Read more >
Attribution - Firas Moosvi
Choosing incorrect choices as well as not choosing correct choices will result in deductions. When object A causes object B to accelerate, ...
Read more >
Working with the icasa wall switch blueprint : r/homeassistant
Intel NUC running ESXi 6.7 with a homeassistant VM. ... 2021, 8:57:00 PM Error: UndefinedError: 'dict object' has no attribute 'event'.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found