obsidian-wielder
obsidian-wielder copied to clipboard
[Bug] Wielder Causing Issues with Templater's Startup Template
The plugin templater has the ability to set a "startup template" that runs when Obsidian is started. However, when wielder is enabled, the startup template fails to run with a vast error. Prior to the template running (as it happens onLayoutReady
), Wielder prints the following error:
Uncaught (in promise) TypeError: import_sci.default.init is not a function
at initialize (plugin:wielder:85392:29)
at ObsidianClojure.eval (plugin:wielder:85553:21)
at Generator.next (<anonymous>)
at fulfilled (plugin:wielder:36:24)
After that, the startup template runs and results in a very big error that mentions certain wielder properties. The error is massive, and hence is attached as a error.txt.
From a basic scan of the error, it looks like it may be related to my startup template's use of obsidian-requirejs that isn't playing nicely with it.
I hadn't restarted Obsidian in a while and hence only just saw this!
Hm, interesting. Haven't seen this before so thanks for reporting it.
Yeah, my first hunch is that because obsidian-requirejs
defines a bunch of global things with very common names, something somewhere gets used when it shouldn't. Quick look at the source reveals this:
//@ts-ignore
window.requirejs = requirejs;
//@ts-ignore
window.define = define;
I'm not sure why it would clash with anything we're doing in Wielder, but probably the final bundle has to be generated somewhat differently to fix this, as it doesn't seem well enough isolated.
I'll take a deeper look when I have time.
Makes sense! Thanks for the update!