chrisgrieser / shimmering-obsidian

Alfred Workflow with dozens of features for controlling your Obsidian vault.
https://alfred.app/workflows/chrisgrieser/shimmering-obsidian/
MIT License
850 stars 41 forks source link

[BUG] Getting `JSON Parse error` when running `o ...` command #44

Closed ericbiewener closed 2 years ago

ericbiewener commented 2 years ago

Describe the Bug Same initial error as this issue, but it has never worked for me since I just installed this workflow today.

o ... command not working

To Reproduce

  1. Install metadata extractor
  2. Install this workflow
  3. run oupdate
  4. try running o ...

I have confirmed that the following files exist in <vault>/.obsidian/plugins/metadata-extractor:

data.json
main.js
manifest.json

Debugging Log

[12:16:51.997] Shimmering Obsidian[Script Filter] Queuing argument '(null)'
[12:16:52.220] Shimmering Obsidian[Script Filter] Script with argv '(null)' finished
[12:16:52.221] ERROR: Shimmering Obsidian[Script Filter] Code 1: /Users/ericbiewener/Drive/App Settings/Alfred.alfredpreferences/workflows/user.workflow.1B2C8640-B18E-461B-AB4D-CA73E3590924/scripts/o_search.js: execution error: Error: SyntaxError: JSON Parse error: Unexpected EOF (-2700)

Version Information

_
-------------------------------
Metadata JSONs: 0/3
Metadata not found. Please run `osetup` and retry.
-------------------------------
INSTALLED VERSION
macOS: 11.6
Obsidian: 
Alfred: 4.6.1
Workflow: 2.12.3
Advanced URI Extractor: 1.16.1
Metadata Extractor: 0.2.4
-------------------------------
LATEST VERSION
Obsidian: 0.13.14
Obsidian (Insider): 0.13.18
Workflow: 2.12.3
Advanced URI Extractor: 1.16.1
Metadata Extractor: 0.2.4
-------------------------------

Checklist

chrisgrieser commented 2 years ago

data.json main.js manifest.json

however, those are the are not the files needed, you need these three files in the directory. And you debugging log says they are not:

Metadata JSONs: 0/3 Metadata not found.

Those are the three files needed:

metadata.json
allExceptMd.json
tags.json
  1. run oupdate

You need to run osetup, not oupdate. Most likely, that's why the metadata didn't get written properly. Have a made a mistake in the docs somewhere you thought it's oupdate that you need? 🤔

ericbiewener commented 2 years ago

I have run osetup as well and get the success notification & automatic Obsidian restart. But I still don't see those files listed in .obsidian/plugins/metadata-extractor -- or should they be in a different location?

I ran oupdate based on a suggestion in this comment, but now I see I misread it and really needed to run Manually Refresh Metadata. But I have done that as well and still see no change in the metadata-extractor plugin directory, and I get the same debug error.

chrisgrieser commented 2 years ago

that means the files are somehow not written correctly by the metadata extractor.

could you make a screenshot of the metadata extractor plugin settings?

also, open the Alfred debugging log, then run osetup or oupdateManually Refresh metadata. And post what the debugging log says when it's trying to write the metadata.

ericbiewener commented 2 years ago

Ah, I'm sorry @chrisgrieser, the metadata extractor plugin was disabled. I'm an Obsidian noob and keep forgetting that after installing plugins they start out as disabled. Everything is working fine now. Sorry for wasting your time!

chrisgrieser commented 2 years ago

no worries! Obsidian is a lot to take in, and my Alfred workflow certainly also has some extensive docs. 😅 🙂