Ankihub error

Before the error happened, I was…
doing cards. this add on has been broken for about a month. i disabled it briefly so i could do my cards without being interrupted w the error message. i just tried to re-enable it again and it crashed.

Error message (don't change this)
Anki 26.08.1 (39e4b0b4) (ao)
Python 3.13.14 Qt 6.11.0 PyQt 6.11.0
Platform: macOS-26.5.2-arm64-arm-64bit-Mach-O

Traceback (most recent call last):

  File "/Users/runner/work/anki/anki/out/installer/build/anki/macos/app/Anki.app/Contents/Resources/app_packages/aqt/webview.py", line 195, in cmd

  File "/Users/runner/work/anki/anki/out/installer/build/anki/macos/app/Anki.app/Contents/Resources/app_packages/aqt/webview.py", line 282, in _onCmd

  File "/Users/runner/work/anki/anki/out/installer/build/anki/macos/app/Anki.app/Contents/Resources/app_packages/aqt/webview.py", line 817, in _onBridgeCmd

  File "/Users/runner/work/anki/anki/out/installer/build/anki/macos/app/Anki.app/Contents/Resources/app_packages/aqt/editor_legacy.py", line 462, in onBridgeCmd

  File "/Users/runner/work/anki/anki/out/installer/build/anki/macos/app/Anki.app/Contents/Resources/app_packages/_aqt/hooks.py", line 2662, in __call__

  File "/Users/Meg/Library/Application Support/Anki2/addons21/1322529746/gui/editor.py", line 90, in _on_field_unfocus_auto_protect
    ah_field_names_lower = {f.lower() for f in ankihub_db.note_type_field_names(NotetypeId(note.mid))}
                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^

  File "/Users/Meg/Library/Application Support/Anki2/addons21/1322529746/db/db.py", line 592, in note_type_field_names
    (field for field in self.note_type_dict(anki_note_type_id)["flds"]),
                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^

TypeError: 'NoneType' object is not subscriptable

Sentry link (for developers)

Hello,

Thanks for reporting this! A fix will be in the next add-on update. The error happens when some notes from an AnkiHub deck have been changed to a different note type.

Until the update is out, you can avoid the error by turning off “Automatically protect fields when edited” under AnkiHub > Deck Management. You can turn it back on after updating the add-on.

If you’d rather move those notes back to the deck’s note type now, you can unsubscribe from the deck in AnkiHub > Deck Management and subscribe again from https://app.ankihub.net. Two things to know before doing that:

  • Anki will need a full sync with AnkiWeb afterwards. Sync your other devices first, then choose to upload from this computer.
  • Your own edits to the deck’s notes may be replaced with the deck’s version, except in fields you have protected.