Bug: JavaScript Error When Editing Card Template Styling in Anki Mobile

Hi everyone,

I encountered a bug in AnkiMobile that I wanted to report. Here’s the sequence to reproduce it:

  1. Open a note and go to “Card Template.”

  2. Edit the code in the template.

  3. Press “Preview” — it works correctly at this point.

  4. Go back and press “Styling” to make further edits to the CSS (I am not sure if the issue persists when trying “Front” and “Back” as well; hadn’t checked)

  5. Return to “Preview” — now an error appears:

Error
A JavaScript exception occurred

This seems to happen consistently after editing the card and trying to preview again once you’ve already previewed the card.

I am using an iPhone 17 Pro Max with iOS 26.2.1.

A post was merged into an existing topic: JavaScript exception on second Card Template:Preview