jon-heard / obsidian-inline-scripts

Obsidian plugin: Type text shortcuts that expand into javascript generated text.
MIT License
129 stars 4 forks source link

Errors in console #75

Open MicahBG opened 1 year ago

MicahBG commented 1 year ago

I do not know if this plugin is still being supported but I have these errors in the console. plugin:obsidian-text-expander-js:4847 Inline Scripts Loaded (0.24.12) plugin:obsidian-text-expander-js:4850 Inline Scripts Shortcut unidentified: "state save" run_internal @ plugin:obsidian-text-expander-js:4850 app.js:1 Error: Plugin "obsidian-text-expander-js" is not passing Component in renderMarkdown. This is needed to avoid memory leaks when embedded contents register global event handlers. at t.render (app.js:1:1255250) at t.renderMarkdown (app.js:1:1255031) at parseMarkdown_internal (plugin:obsidian-text-expander-js:5522:39) at Object.parseMarkdown (plugin:obsidian-text-expander-js:5378:12) at AutoComplete.forceSelectedItem_modified (plugin:obsidian-text-expander-js:8151:58) at e.setSelectedItem (app.js:1:792201) at e.setSuggestions (app.js:1:791959) at t.showSuggestions (app.js:1:1802386) at t.trigger (app.js:1:1802025) at e.trigger (app.js:1:1818518)

technicalpickles commented 10 months ago

Came here to report this. Looks like this is the line it is being raised from: https://github.com/jon-heard/obsidian-inline-scripts/blob/acd25b6009232ac15f4df22582d127bf165e417b/src/HelperFncs.ts#L297

And it looks like it is this method:

renderMarkdown(markdown: string, el: HTMLElement, sourcePath: string, component: Component): Promise<void>;

I haven't worked in the API, but it looks like passing a Plugin extends Component (source), so that would probably be the thing to pass.