-
-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: TypeError: Cannot read properties of undefined (reading 'compile_svg') #59
Comments
I can't reproduce this on Windows but I don't have a Linux machine. Is the same issue present on a new vault with just this plugin installed, with a note with only a typst block? |
Debug Info from Obsidian (in the new Vault):
|
Welll shoot, I've just updated my Obsidian installer to 1.6.5 and it looks like something is wrong with the webassembly in the web worker. This is a pretty serious problem... |
I don't know about web assembly, what I can help with is simply opinionated. According to the changelog version 1.6.5, the installer is using Electron v30.1.2, and currently has a WebWorker related fix in Electron v31.1.0. Is there any connection? |
Any update on this issue? Same on my Linux with Obsidian 1.6.5. |
Sorry I haven't had time to properly diagnose this issue, it seems like something has changed with the electron version v30.1.2. An easy work around would be to downgrade to Obsidian 1.6.3 which doesn't have the electron update. You can find the installers here: https://github.com/obsidianmd/obsidian-releases/releases/tag/v1.6.3 |
I installed electron 31 and changed version in obsidian start script. Now it works well |
I've been doing some debugging. Relevant code that causes the error seems to be here, with specific focus on line 831 where we instantiate. This code is produced by My initial findings make it seem as though the type of Specifically, running |
To add to my response above, I was able to patch the code produced by module = await module.arrayBuffer();
const instance = await WebAssembly.instantiate(module, imports); which makes everything work :D I'm really not sure where the fix for this should go. I'm really not sure why It looks like Really not sure where to go from here for getting a more stable fix in! I think the weirdest part so far for me is that the Obsidian environment does not have a global |
I just updated to Obsidian 1.6.7 (on arch linux) and this issue seems gone. |
Strange, I am on Obsidian 1.6.7 and I had the issue. Very strange that it resolved it for you. |
I did some more testing and it looks like inside However, inside edit: I printed all the globals available inside the worker, and it indeed does seem to be a limited set (which excludes the Response object): List of globals available inside Worker
Frankly I'm now wondering how the |
See issue fenjalien#59 for why this patch is needed. Essentially, inside the web worker environment, the global 'Response' does not exist. As a result, wasm-bindgen's attempt to fetch the binary and parse the Response object does not work. This patch sends the entire wasm binary through to `WebAssembly.instantiate`.
Just put up a PR which should patch this issue! Would love anyone to test it out. You'll need to build the plugin locally:
|
@OverHash |
Hey @ghareebishere, here's my build. I would, of course, recommend that you build yourself if you can. |
The Typst Renderer is no longer broken in Obsidian 1.7.4. |
For me it is working with Obsidian 1.7.4 as well. |
I just updated Obsidian to v1.6.5 and now
TypeError: Cannot read properties of undefined (reading 'compile_svg')
gets displayed for every typst-field.This happens for math-fields (with
$
or$$
) and code-blocks.I am running linux.
Obsidian Version: v1.6.5
The text was updated successfully, but these errors were encountered: