mProjectsCode / obsidian-meta-bind-plugin

A plugin for Obsidian to make your notes interactive with inline input fields, metadata displays, and buttons.
https://www.moritzjung.dev/obsidian-meta-bind-plugin-docs/
GNU General Public License v3.0
490 stars 40 forks source link

Example script 'Activity Tracker' doesn't work #167

Closed simonfossom closed 6 months ago

simonfossom commented 9 months ago

Please fill out these Check-boxes

This Issue Occurs on

Plugin Version

0.10.2

Describe the Issue

Example script 'Activity Tracker' trows error:

Failed to execute JS
Failed to execute JS during execution "6509f34a-6763-41f0-8df3-aced42ef130c"

Error: [MB_VALIDATION] "failed to validate parser result" caused by "Failed to parse bind target. Bind target storage path is undefined."

    at Pc.validateStoragePathAsFilePath (plugin:obsidian-meta-bind-plugin:49:9778)
    at Pc.validateBindTarget (plugin:obsidian-meta-bind-plugin:49:8229)
    at Pc.parseAndValidateBindTarget (plugin:obsidian-meta-bind-plugin:49:7853)
    at Am.createBindTarget (plugin:obsidian-meta-bind-plugin:102:2941)
    at qo.eval [as func] (eval at buildFunction (plugin:js-engine), <anonymous>:5:23)
    at qo.runFunction (plugin:js-engine:39:79271)
    at zo.execute (plugin:js-engine:39:84539)
    at Or.tryRun (plugin:js-engine:39:19287)
    at Or.renderResults (plugin:js-engine:39:19474)
    at Or.render (plugin:js-engine:39:20168)

Steps to Reproduce

open the note from the link: https://github.com/mProjectsCode/obsidian-meta-bind-plugin/blob/0213492d77966304668eb5429f50cc23808aa4f8/exampleVault/Advanced%20Examples/Activity%20Tracker.md

Expected Behavior

Script should execute.

mProjectsCode commented 9 months ago

yeah, that is still using the old syntax. I will update this soon.

mProjectsCode commented 9 months ago

should be fixed now

simonfossom commented 9 months ago

@mProjectsCode sorry for late reaction but the problem persists in my vault. tried on clean vault same error.

Screenshot 2024-01-07 at 22 59 04

mProjectsCode commented 9 months ago

Did you copy the example from the latest commit of the master branch? Because that version works for me without any problems.

simonfossom commented 9 months ago

Yes! sorry. my bad. works. I must of copied the old code

LynetteCullens commented 6 months ago

Activity Tracker and PF2e Encounter Calculator are not working in the example vault. All JavaScript codes are broken in the example vault.

Failed to execute JS
Failed to execute JS during execution "909030fd-61ea-407d-8774-f419e44c0ba2"

Error: [MB_INTERNAL] "invalid arguments supplied to function" caused by error "[
  {
    "code": "invalid_type",
    "expected": "array",
    "received": "undefined",
    "path": [
      "property"
    ],
    "message": "Required"
  }
]"
    at jr (plugin:obsidian-meta-bind-plugin:110:56155)
    at Ah.createBindTarget (plugin:obsidian-meta-bind-plugin:111:17437)
    at Bo.eval [as func] (eval at buildFunction (plugin:js-engine), <anonymous>:5:23)
    at Bo.runFunction (plugin:js-engine:45:61422)
    at Go.execute (plugin:js-engine:45:66794)
    at qr.tryRun (plugin:js-engine:45:1053)
    at qr.renderResults (plugin:js-engine:45:1240)
    at qr.render (plugin:js-engine:45:1934)
    at qr.onload (plugin:js-engine:45:2188)
    at e.load (app://obsidian.md/app.js:1:1167250)
mProjectsCode commented 6 months ago

I updated the example to use the new API. I also had to fix a few things in the plugin which I overlooked in the 1.0 release. I will release an update to the plugin possibly later today.