Help! Now getting 'Parsing Error "" is not a function' on all templates!

Things I have tried

Hello, and thanks for what has been up until this past week a great tool for Obsidian! I’ve been using it for about a month now and everything I’ve done with Obsidian and Templator has been fine. Lot’s of good examples, including Obsidian-Scraper by @Basilios which I was able to modify to suit my needs, and it was all were working great up until about a week ago.
I’ve tried multiple clean installs of Obsidian and Templator, and no matter what, I get the same error. I think it all started with the 1.0 upgrade.

I’ve upgraded to 1.0.3 and I have the latest version of Templater, but like I said, this started with 1.0. I’ve been working on debugging this, non-stop for the past week, searching issues, forums, etc. No luck, which I find really strange :-o!
I’m not a stack programmer, but I’m okay tweaking JS a little bit, as long as I can back it out if I need to.
For testing purposes I started with the first example given on the Templater Introduction page, and I took out the daily quote, because I read a post where there was problems with that. But even just that bit of code fails.
I did have some success removing the front-matter, but after I tried to add it back, the error comes back, and then (and THIS IS REALLY WEIRD!), even if I remove it again, exit and come back in, I get the same error without the front-matter! It’s like something gets corrupted and it can’t be repaired.

What I’m trying to do

What I’m trying to do is just create a new file with a template. For example just creating the daily note, with the above mentioned test template:

---
creation date: <% tp.file.creation_date() %>
modification date: <% tp.file.last_modified_date("dddd Do MMMM YYYY HH:mm:ss") %>
---

<< [[<% tp.date.now("YYYY-MM-DD", -1) %>]] | [[<% tp.date.now("YYYY-MM-DD", 1) %>]] >>

# <% tp.file.title %>

fails with the same error:

Templater Error: Template parsing error, aborting. ***
*** “” is not a function

I am about to give up at this point, so any help would be greatly appreciated!

1 Like

Forgot to include the Console output! See below:

app.js:1 Obsidian Developer Console
plugin:dataview:20685 Dataview: version 0.5.47 (requires obsidian 0.13.11)
plugin:dataview:13951 Dataview: all 29 files have been indexed in 0.05s (29 cached, 0 skipped).
plugin:dataview:13955 Dataview: Dropped cache entries for 1 deleted files.
plugin:templater-obsidian:82 Templater Error: Template parsing error, aborting.
“” is not a function
log_error @ plugin:templater-obsidian:82
eval @ plugin:templater-obsidian:103
rejected @ plugin:templater-obsidian:57
Promise.then (async)
step @ plugin:templater-obsidian:62
eval @ plugin:templater-obsidian:63
__async @ plugin:templater-obsidian:47
errorWrapper @ plugin:templater-obsidian:98
eval @ plugin:templater-obsidian:3907
eval @ plugin:templater-obsidian:63
__async @ plugin:templater-obsidian:47
overwrite_file_commands @ plugin:templater-obsidian:3905
eval @ plugin:templater-obsidian:3995
fulfilled @ plugin:templater-obsidian:50
Promise.then (async)
step @ plugin:templater-obsidian:62
eval @ plugin:templater-obsidian:63
__async @ plugin:templater-obsidian:47
on_file_creation @ plugin:templater-obsidian:3973
eval @ plugin:templater-obsidian:4053
e.tryTrigger @ app.js:1
e.trigger @ app.js:1
t.trigger @ app.js:1
t.onChange @ app.js:1
e.trigger @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
m @ app.js:1
e.reconcileFileCreation @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
a @ app.js:1
Promise.then (async)
l @ app.js:1
(anonymous) @ app.js:1
m @ app.js:1
e.reconcileFileInternal @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
a @ app.js:1
Promise.then (async)
l @ app.js:1
a @ app.js:1
Promise.then (async)
l @ app.js:1
(anonymous) @ app.js:1
m @ app.js:1
e.reconcileFile @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
m @ app.js:1
e.reconcileInternalFile @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
a @ app.js:1
Promise.then (async)
l @ app.js:1
a @ app.js:1
Promise.then (async)
l @ app.js:1
(anonymous) @ app.js:1
m @ app.js:1
(anonymous) @ app.js:1
n @ app.js:1
Promise.then (async)
e.queue @ app.js:1
e.write @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
a @ app.js:1
Promise.then (async)
l @ app.js:1
(anonymous) @ app.js:1
m @ app.js:1
t.create @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
m @ app.js:1
e.createNewMarkdownFile @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
a @ app.js:1
Promise.then (async)
l @ app.js:1
(anonymous) @ app.js:1
m @ app.js:1
e.getDailyNote @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
(anonymous) @ app.js:1
m @ app.js:1
e.onOpenDailyNote @ app.js:1

Again, any help would be greatly appreciated. I know this is coming from the Templater plugin, but since it first appeared with the Obsidian 1.0 upgrade, I thought I’d start looking for help here. TIA!

Do you have an user scripts? If yes, Try removing those.

Thank you, @shabegom !

This turned out to be the issue. As you pointed out, even if one script exists in the folder with an error in it, Templater will fail across the board, regardless of whether it’s used or not!

1 Like

I’ve had same problem - but deleted all scripts except for one which works - and Templater STILL doesn’t work. Am I missing something elementary ?

If it helps a Twita, what if you move the script that works anyway, and see if you still can’t save. I thought my scripts worked the night before, but I guess something changed with an auto-upgrade, overnight, so they didn’t. Deleting all of them (I had copies) proved that that was the problem allowing me to zero in on the issue.
I even deleted all my templates, too. HTH!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.