shabegom / buttons

Buttons in Obsidian
The Unlicense
459 stars 47 forks source link

[Bug] Uncaught TypeError: Cannot read property 'filter' of null #17

Closed ShreyasKallingal closed 3 years ago

ShreyasKallingal commented 3 years ago

I opened up the dev console to work on an unrelated plugin, but I quarantined this exception to the buttons plugin. Whenever I start typing in the editor, I get one of two exceptions in the console:

app.js:1 Uncaught TypeError: Cannot read property 'filter' of null
    at removeDuplicates (eval at <anonymous> (app.js:1), <anonymous>:208:16)
    at addButtonToStore (eval at <anonymous> (app.js:1), <anonymous>:174:11)
    at eval (eval at <anonymous> (app.js:1), <anonymous>:216:9)
    at t.e.tryTrigger (app.js:1)
    at t.e.trigger (app.js:1)
    at t.trigger (app.js:1)
    at t.<anonymous> (app.js:1)
    at app.js:1
    at Object.next (app.js:1)
    at s (app.js:1)

and

app.js:1 Uncaught TypeError: store is not iterable
    at addButtonToStore (eval at <anonymous> (app.js:1), <anonymous>:173:44)
    at eval (eval at <anonymous> (app.js:1), <anonymous>:216:9)
    at t.e.tryTrigger (app.js:1)
    at t.e.trigger (app.js:1)
    at t.trigger (app.js:1)
    at t.<anonymous> (app.js:1)
    at app.js:1
    at Object.next (app.js:1)
    at s (app.js:1)

Steps to reproduce:

  1. Open any note (doesn't matter if there's a button code block or not)
  2. Start typing in note
  3. Observe console

I turned off all other plugins as well when testing this. Thank you!

shabegom commented 3 years ago

I will address ASAP

shabegom commented 3 years ago

@ShreyasKallingal please update to 0.3.2 and confirm these errors are gone. Thanks!

ShreyasKallingal commented 3 years ago

Looks like it's working now without errors. Thank you for the quick turnaround!