PKM-er / obsidian-zotlit

A third-party project that aims to facilitate the integration between Obsidian.md and Zotero, by providing a set of community plugins for both Obsidian and Zotero.
https://zotlit.aidenlx.top
MIT License
584 stars 25 forks source link

MacOS can't open plugin #337

Open qiancijun opened 2 months ago

qiancijun commented 2 months ago

macOs Sonoma 14.4.1, M2 Max.

image
qiancijun commented 2 months ago

obsidian version 1.5.12

alemsabic commented 2 months ago

This is also the case for me. Cannot be opened.

Servinjesus1 commented 1 month ago

Can confirm issue as well.

Break happens immediately after reading zotero sqlite database.

To get plugin to at least load, edit data.json and put something incorrect in for the "zoteroDataDir" location (like C:\\Users\\user\\Zotero). That way the plugin can't autoload your SQLite. This was useful only to enable ALL level debugging, of course the plugin can't really work until the database is loaded. After doing this, I removed Application Support/Obsidian/better-sqlite...node to force plugin to re-install, then recorded the errors following reload now in Debug=ALL mode:

image

qiancijun commented 1 month ago

Can't work, The plugin did not generate the data.json file. So i manual create one and change zoteroDataDir location. Console print can not find sqlite file.

image

But when i change the correct path, nothing print and no prompt to install the better-sqlite plugin. In Application Support folder, Obsidian not generate.

Servinjesus1 commented 1 month ago

@qiancijun, my comment was to supply the developer with some error messages related to the exact moment the plugin crashes. You don't have to reproduce these errors, but if you want to:

  1. Have you tried reloading the plugin? Turn it off and on again in Community Plugins
  2. If better-sqlite is installed, Obsidian should crash immediately and you might get the same errors as me
  3. To fully reproduce reinstall of better-sqlite, be sure to delete any existing .node files at ~/Library/Application Support/Obsidian.
Servinjesus1 commented 1 month ago

Just tried with Zotero 7 Beta (7.0.0-beta.77+adaa61f2c) and its version of the sqlite database. Same crash.

Also, if you get stuck with the plugin loading when you open Obsidian and immediately breaking it, overwrite plugins/zotlit/data.json with something bare like this:

{
  "zoteroDataDir": "fake/dir"
}

otherwise it loads the defaults which may find your sqlite at the Mac default path.

jensenojs commented 1 month ago

not sure if relatived,

Servinjesus1 commented 1 month ago

Holla! Thanks Jensen, that solved it!

For others, I recommend to AppClean Obsidian to ensure all components of the application uninstall (don't worry, it won't affect your Vaults), then re-download the app.

OP (@qiancijun) I suggest closing this as a duplicate of #325 once you've got it working for yourself.

jensenojs commented 1 month ago

@Servinjesus1 Sorry, in fact I did not fix this issue. This issue was closed and was only resolved after the version upgrade (v.1.5.11).

But our current version is still a little higher than it

Servinjesus1 commented 1 day ago

@jensenojs I recognize you didn’t solve the problem in #325 but the solution in that thread worked for me, so thank you for linking to it.

To be clear, try followingthe answer to 325 by uninstalling Obsidian and reinstalling with a newly downloaded copy from the web. This can happen if the updater doesn’t upgrade certain components correctly, so starting fresh and new can help.