obsidian-git icon indicating copy to clipboard operation
obsidian-git copied to clipboard

[Bug]: Plugin does not load

Open invisi-splat opened this issue 3 years ago • 4 comments

Describe the bug

Plugin does not load and returns errors when Obsidian starts up.

Relevant errors (if available)

VM266:14248 loading Obsidian Git plugin
VM266:11181 Error: spawnSync git EPERM
    at Object.spawnSync (internal/child_process.js:1067)
    at spawnSync (child_process.js:611)
    at SimpleGit.isGitInstalled (eval at <anonymous> (app.js:1), <anonymous>:11177:57)
    at SimpleGit.eval (eval at <anonymous> (app.js:1), <anonymous>:10830:16)
    at Generator.next (<anonymous>)
    at eval (eval at <anonymous> (app.js:1), <anonymous>:66:61)
    at new Promise (<anonymous>)
    at __async (eval at <anonymous> (app.js:1), <anonymous>:50:10)
    at SimpleGit.setGitInstance (eval at <anonymous> (app.js:1), <anonymous>:10829:12)
    at ObsidianGit.eval (eval at <anonymous> (app.js:1), <anonymous>:14421:33)
isGitInstalled @ VM266:11181
VM266:14762 git obsidian error: TypeError: Cannot read property 'checkIsRepo' of undefined
VM266:14455 TypeError: Cannot read property 'checkIsRepo' of undefined
    at SimpleGit.eval (eval at <anonymous> (app.js:1), <anonymous>:11059:28)
    at Generator.next (<anonymous>)
    at eval (eval at <anonymous> (app.js:1), <anonymous>:66:61)
    at new Promise (<anonymous>)
    at __async (eval at <anonymous> (app.js:1), <anonymous>:50:10)
    at SimpleGit.checkRequirements (eval at <anonymous> (app.js:1), <anonymous>:11055:12)
    at ObsidianGit.eval (eval at <anonymous> (app.js:1), <anonymous>:14423:46)
    at Generator.next (<anonymous>)
    at fulfilled (eval at <anonymous> (app.js:1), <anonymous>:53:24)

Steps to reproduce

Load up Obsidian with plugin already enabled

Expected Behavior

Plugin to load without errors

Addition context

Running the Obsidian Git: Open source control view command brings up this screen: image The refresh wheel spins indefinitely.

Uninstalling and reinstalling the plugin makes it work fine.

Operating system

Windows 10

Obsidian version

0.14.6

Plugin version

1.25.3

invisi-splat avatar Jun 06 '22 20:06 invisi-splat

What did you set as a custom git binary path?

Vinzent03 avatar Jun 07 '22 07:06 Vinzent03

I left it blank. git is on my PATH. The issue only arises when I load up the plugin in conjunction with Obsidian; reloading the plugin allows it to work fine.

invisi-splat avatar Jun 07 '22 08:06 invisi-splat

So you all get the error message: Error: spawnSync git EPERM? Watch out for EPERM in the console, because ENOENT is much more common? I don't know what could be different from my side whether it loads with Obsidian or later.

Vinzent03 avatar Jun 07 '22 19:06 Vinzent03

Yep - EPERM.

Disabling and reenabling the plugin has proved temperamental recently too - sometimes, it takes two or three tries for it to load up successfully. The plugin has not crashed on me so far, so it's definitely something to do with loading it up in my case.

invisi-splat avatar Jun 07 '22 22:06 invisi-splat

I cannot reproduce and don't know what to fix, because on Obsidian load and plugin load should be identical.

Vinzent03 avatar Sep 21 '22 10:09 Vinzent03