Uncaught (in promise) TypeError: cleanup is not a function
at browser_editor.js:64505:13
at run (browser_editor.js:61762:12)
at Array.forEach (<anonymous>)
at run_all (browser_editor.js:61768:9)
at destroy_component (browser_editor.js:63416:7)
at Object.d (browser_editor.js:109016:9)
at Object.d (browser_editor.js:65379:24)
at destroy_component (browser_editor.js:63417:34)
at Object.d (browser_editor.js:109065:9)
at Object.d (browser_editor.js:89279:32)
Relevant code:
return () => {
for (const cleanup of cleanups) {
cleanup();
}
};
The way the API is written currently, one must provide a cleanup function, otherwise the App will crash. Also, it has to be synchronous (although most Svelte interactions require awaiting an element). I will try to improve this upstream, but for now need to fix this issue with somewhat verbose callbacks.
As reported on the forum (https://forums.ankiweb.net/t/tippy-tooltips-official-support/11844/133), the reloading of Svelte components such as the toolbar or fields causes a crash:
Relevant code:
https://github.com/ankitects/anki/blob/5e0a761b875fff4c9e4b202c08bd740c7bb37763/ts/sveltelib/lifecycle-hooks.ts#L43-L47
The way the API is written currently, one must provide a cleanup function, otherwise the App will crash. Also, it has to be synchronous (although most Svelte interactions require awaiting an element). I will try to improve this upstream, but for now need to fix this issue with somewhat verbose callbacks.