shabegom / buttons

Buttons in Obsidian
The Unlicense
455 stars 47 forks source link

TypeError when clicking button #53

Closed darthmachina closed 3 years ago

darthmachina commented 3 years ago

When clicking a button nothing happens and the following error is shown in the Console:

Uncaught (in promise) TypeError: Cannot read property 'settings' of undefined
    at template (eval at <anonymous> (app.js:1), <anonymous>:1202:55)
    at eval (eval at <anonymous> (app.js:1), <anonymous>:1413:13)
template @ buttonTypes.ts:104
eval @ button.ts:85
async function (async)
eval @ button.ts:81
setTimeout (async)
clickHandler @ button.ts:80
async function (async)
clickHandler @ button.ts:57
eval @ button.ts:45
s @ app.js:1

I just installed Buttons and this happens with the first button that I create, using Button Maker. I do not see any settings tab for Buttons under Plugin Options in the Obsidian Settings dialog. I'm not sure if there is supposed to be one, just going off of the context of the error message.

Here is the text that I'm using:

button
name Create Task
type note(Task) template
action Task Template

Obsidian Version: 0.12.4 Buttons Version: 0.4.10

shabegom commented 3 years ago

Thanks for reporting. I think I know what's happening here.

You don't have Templater installed right? I can handle that and prevent the error.

darthmachina commented 3 years ago

No, I don't have Templater installed. I do want to switch to that but I haven't yet.

darthmachina commented 3 years ago

FWIW I can confirm that installing Templater does fix the issue

shabegom commented 3 years ago

Should be fixed in 0.4.11 Thanks again for reporting!