Since the most recent update all my dataviewjs references are getting the following error:
TypeError: Script methods can only be called on script instances.
Steps to reproduce
For example:
dv.view("dv-views/annotations/v1")
Which contains the following script:
var dvUtils = require(app.vault.adapter.basePath + "/π¦ Resources/πββοΈ Runbooks/π§° Devops/dv-views/dvUtils.js");
let curr = dv.current();
let quote = curr.file.frontmatter.quote;
let sources = curr.file.frontmatter.sources;
let person = sources[0].person != "" ? sources[0].person : "Unknown";
let place = sources[0].place != "" ? sources[0].place : "Unknown";
let location = sources[0].location != "" ? " | " + sources[0].location : "";
let acknowledgement;
let quoteblock = `
>[!quote] ${quote}
><span class="source"><span class="person"> ${person} </span></br>
><span class="place">${place} ${location}</span></span>
`
dv.span(quoteblock)
Did you follow the troubleshooting guide? [Y/N]
I did but I had some trouble recreating the issue exactly. From this I did confirm that the issue is based on the first line:
var dvUtils = require(app.vault.adapter.basePath + "/π¦ Resources/πββοΈ Runbooks/π§° Devops/dv-views/dvUtils.js");
Iβm assuming this error refers to the require()
but I donβt understand the language βScript methods can only be called on script instances.β
Expected result
Actual result
Environment
SYSTEM INFO:
Obsidian version: v1.4.2
Installer version: v1.3.4
Operating system: Darwin Kernel Version 22.5.0: Thu Jun 8 22:22:20 PDT 2023; root:xnu-8796.121.3~7/RELEASE_ARM64_T6000 22.5.0
Login status: logged in
Catalyst license: insider
Insider build toggle: on
Live preview: on
Legacy editor: off
Base theme: dark
Community theme: Things v2.1.6
Snippets enabled: 4
Restricted mode: off
Plugins installed: 33
Plugins enabled: 20
1: Hotkeys++ v0.2.7
2: Natural Language Dates v0.6.1
3: Templater v1.16.0
4: Periodic Notes v0.0.17
5: Obsidian Query Language v2.1.1
6: Dataview v0.5.56
7: Advanced Mobile Toolbar v1.8.0
8: Advanced Tables v0.19.1
9: Folder Note v0.7.3
10: PlantUML v1.6.6
11: QuickAdd v1.2.1
12: Tag Wrangler v0.5.11
13: Banners v1.3.3
14: LanguageTool Integration v0.3.4
15: Calendar v1.5.10
16: Bible Reference v1.7.3
17: Scales and Chords v1.0.1
18: Excalidraw v1.9.15
19: Importer v1.1.0
20: Tasks v4.5.0
Additional information
I use this require()
call on all my scripts to have common functions available to me so any help in understanding the issue will help. Thanks!