jplattel / obsidian-query-language

An Obsidian plugin allowing you to query your notes
176 stars 6 forks source link

Can't use plugin with error #7

Closed BigbadHort closed 3 years ago

BigbadHort commented 3 years ago

Hi I can't use plugin with error : TypeError: Cannot read property 'search' of undefined

Could you help me please

my system - Win10 Obsidian 0.10.11

jplattel commented 3 years ago

Hey @BigbadHort , could you include the queryblock that you use? That will help out figuring out where the error is :)

gammak commented 3 years ago

Seeing the same issue here. Sample query:

    ```oql
    name: "Daily notes"
    query: "'daily/'"
    template: "{name}: {count}"
    debug: true
    ```

Yields, in the preview,

TypeError: Cannot read property 'search' of undefined // Debugging OQL, total results: 0 // Query: 'daily/' // Results:

Seeing similar results after changing the query to "'./'" and the template to "{count}"

cmjn14 commented 3 years ago

Hi, I have the same issue running Obsidian V0.10.11

My query:

query: "'AUTHORS/"          
template: "list"
debug: true

In the preview:

TypeError: Cannot read property 'search' of undefined

// Debugging OQL, total results: 0
// Query: 'AUTHORS/
// Results: 

In the console:

Uncaught TypeError: Cannot read property 'remove' of undefined
    at FuseSearchIndex.removeFile (eval at <anonymous> (app.js:1), <anonymous>:1907:33)
    at ObsidianQueryLanguagePlugin.refreshFile (eval at <anonymous> (app.js:1), <anonymous>:27095:25)
    at eval (eval at <anonymous> (app.js:1), <anonymous>:27064:27)
    at t.e.tryTrigger (app.js:1)
    at t.e.trigger (app.js:1)
    at t.trigger (app.js:1)
    at t.onChange (app.js:1)
    at e.trigger (app.js:1)
    at e.<anonymous> (app.js:1)
    at app.js:1
jplattel commented 3 years ago

Are these issues still persisting? It might have to do with the OQL block running before the index is build. Can you confirm with the latest version of the plugin: 1.5.0?

cmjn14 commented 3 years ago

I tried quickly with a very simple query this morning and it works fine :-) I'll try more complex queries later Thanks!!!

uwidev commented 3 years ago

I had the issue too after installing the plugin. Closing and reopening Obsidian appears to have fixed the problem.

jplattel commented 3 years ago

Alright! In version 2.0.0 this should be solved! In the case that the indexing isn't done yet a better warning in shown instead of 'search' is undefined. Closing this :)