Fevol / obsidian-criticmarkup

Annotate notes with comments and suggestions using CriticMarkup in Obsidian
MIT License
126 stars 2 forks source link

[BUG] Plugin fails to load properly when installing/enabling it the first time #18

Open lifehaschanged opened 2 months ago

lifehaschanged commented 2 months ago

When this Plugin is installed with BRAT (sandbox vault without any other plugins than BRAT): https://github.com/TfTHacker/obsidian42-brat

It's causing many errors and showing me no sidebars and commands:

grafik

Do you plan to make this plugin available for BRAT / Community Plugin store inside Obsidian?

lifehaschanged commented 2 months ago

@Fevol

I have installed it manually by pasting the files main.js manifest.json styles.css into the obsidian plugins directory. However, after activating the plugin inside Obsidian, no settings, no commands or sidebars where visible.

It would really be wonderful if you could test that in a fresh vault to see if it's just me or the current Obsidian versions.

The "field is not present in this state" error occurs on every range:

Addition: {++ ... ++}
Deletion: {-- ... --}
Comment: {>> ... <<}
lifehaschanged commented 2 months ago

Finally a restart of the whole vault after the plugin installation solved it. Hence you can't test this plugin in a sandbox vault, because after restart it the sandbox vault would be gone. @Fevol It would be really helpful to inform the users that they need to restart obsidian/vault to use the plugin.

Fevol commented 2 months ago

I'm reopening this issue as I definitely do not intend for users having to restart Obsidian in order to have this plugin to work, besides, it does seem like it is some kind of race condition between the plugin initalisation and the codemirror extensions - which only occurs if the plugin is not initialised with the loading of the app.

Many thank for the detailed issue report and checking the sandbox vault. I will try to fix this as soon as I have some time again (which should be a month from now)

Fevol commented 2 months ago

Addendum, potentially related to #16

lifehaschanged commented 2 months ago

Thank you for the feedback and reopening the topic. Please excuse me for closing it so quickly. Of course, modifying the plugin to make it available to all users without a restart is much better.