-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Cannot read files on iOS #38
Comments
By the way, on iPad this plugin didn't download the missing libraries like it did on the computer, so I manually imported all the library files to |
Unfortunately I don't have access to an apple device so I haven't been able to do any testing on iOS. Could you give me some more details?
Are you saying that with everything (and I mean EVERYTHING) the same except the platform is either iPad or Windows, it works on Windows but not iPad? If not what are the differences or what happens if everything is the same? Could show your iOS, Obsidian, plugin versions and any other plugins you have enabled? With the errors I would guess its Typst refusing to access the file before actually attempting to read the file. Could you change the first file path to a file that doesn't exist but in the same folder? Something like
How do you know this and what error does it give?
I doubt this is the root cause but make sure they're in the same structure as in the computer. |
First, I don't think this error is caused by other plugins, because when I disable all other plugins and only keep the Typst Renderer, I get the same error message. But if you're going to need it, here's my list of plugins on the ipad. (from community-plugins.json)
For I'm using "Windows 11 Version 22H2 22621.1992" and "iPadOS 17.2".
On the computer, typst automatically detected the missing libraries and then downloaded them automatically, on the iPad I waited for a long time and nothing happened, so I copied all contents from I'm sorry that I don't know much about how the Obsidian plugin actually works, so I can only judge it superficially: it seems to me that the way access permissions to files are determined on iOS/iPadOS is not quite the same as on Windows/Android, which may be the cause of the problem. Finally, thank you for your work on this plugin, it has helped me a lot. |
Thanks for the info! I've had a look at the code as an access denied error can't be thrown on mobile on a file read attempt, only before within the Typst compiler. Its a bug the wrong error is thrown however the actual error still gets printed to the console. Would you be able to get access to the console on your iPad and show the error? I'm not sure how exactly to do this for apple devices as I only have android, but this: https://github.com/KjellConnelly/obsidian-dev-tools might be something. Could you also try in a new vault only on your iPad with only the plugin? |
Thank you! I'm not sure I can diagnose this issue without an apple device with me as there should be more error messages than this... I have a bad feeling its because the way in which files are read is only available on android and not iOS. Which is a great shame as there was literally no other way to do it.
Yes, the compiler works on a separate thread where the file reading is different (and not working) but the main thread can read the file system fine and tell the compiler which packages are available. If the package isn't available the main thread attempts to download the package then restart the compiler. I'm assuming you do have an internet connection in which case its receiving a 404 error meaning the package doesn't exist (which it definitely does). Any other issues in fetching the package should result in a different error. |
Could you not get around this by allowing typst packages and the WASM bundle to be stored in a user-defined folder in the vault (#52)? Once that is done, they should be able to be read by the vault adapter just like any other file. |
You're right. But I think the An addition, I've noticed that it's not an iOS-only problem. The mobile device does not recognize the nodejs Hey @fenjalien, I'm already working on implementing the change to the |
Typst packages and the WASM bundle are being stored in the vault, its under I'm sure I've written this before but I'll reiterate, the biggest hurdle when reading files is that the Typst compiler calls the "read this file please" function synchronously but Obsidian mobile only provides asynchronous ways to read files. Thats all the problem is and its annoyingly difficult to solve in this case. I'll now highlight the possible solutions I've tried and their problems:
I've already put a lot of time into solving this problem with very little to show for it, so I'm unwilling to try harder with all these ideas.
You might have noticed by now but the mobile version should not be using the path library as its a Node module and is not available on mobile, there are checks in place to make sure it doesn't even try to use it.
Make it separate, but I don't think it'll fix anything. |
Yea, the #Edit |
All features work fine on my computer(windows) and Android phone.
When it comes to the iPad, everything works fine when using only the features of Typst itself, but I get error when I use the files in the Obsidian library or import typst packages.
I've noticed that this problem seems to have been fixed in #9, is there something wrong with the way I'm using it on iPad?
The text was updated successfully, but these errors were encountered: