Jwrede / Anki-KaTeX-Markdown

Creates a new Basic and a new Cloze Note Type that support Markdown and KaTeX
74 stars 5 forks source link

Error on startup and no preview #18

Closed hoppla20 closed 2 years ago

hoppla20 commented 2 years ago

Error Log

Error 
An error occurred. Please start Anki while holding down the shift key, which will temporarily disable the add-ons you have installed. 
If the issue only occurs when add-ons are enabled, please use the Tools>Add-ons menu item to disable some add-ons and restart Anki, repeating until you discover the add-on that is causing the problem. 
When you've discovered the add-on that is causing the problem, please report the issue on the add-ons section of our support site. 
Debug info:
Anki 2.1.15 (442df9d6) Python 3.9.7 Qt 5.15.2 PyQt 5.15.0
Platform: Linux
Flags: frz=False ao=True sv=1
Add-ons possibly involved: Markdown and KaTeX Support

Caught exception:
  File "/usr/share/anki/aqt/progress.py", line 72, in handler
    func()
  File "/usr/share/anki/aqt/main.py", line 136, in setupProfile
    self.loadProfile()
  File "/usr/share/anki/aqt/main.py", line 276, in loadProfile
    runHook("profileLoaded")
  File "/usr/share/anki/anki/hooks.py", line 29, in runHook
    func(*args)
  File "/home/vincentcui/.local/share/Anki2/addons21/1087328706/__init__.py", line 53, in create_model_if_necessacy
    update()
  File "/home/vincentcui/.local/share/Anki2/addons21/1087328706/__init__.py", line 120, in update
    _add_file(os.path.join(addon_path, "_katex.min.js"), "_katex.min.js")
  File "/home/vincentcui/.local/share/Anki2/addons21/1087328706/__init__.py", line 136, in _add_file
    mw.col.media.add_file(path)
<class 'AttributeError'>: 'MediaManager' object has no attribute 'add_file'
hoppla20 commented 2 years ago

image

hoppla20 commented 2 years ago

Fixed by updating to version 2.1.48. In version 2.1.15 anki used snake case, which was changed in later versions to camel case.