Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Add a template to the current note v1.9.5 #391

Closed
Borber opened this issue Sep 30, 2021 · 22 comments
Closed

[BUG] Add a template to the current note v1.9.5 #391

Borber opened this issue Sep 30, 2021 · 22 comments
Assignees
Labels

Comments

@Borber
Copy link

@Borber Borber commented Sep 30, 2021

Log.ts:17 Templater Error: Template parsing error, aborting.
Assignment to constant variable.
log_error @ Log.ts:17
eval @ Error.ts:16
rejected @ tslib.es6.js:74
Promise.then (async)
step @ tslib.es6.js:75
eval @ tslib.es6.js:76
__awaiter @ tslib.es6.js:72
errorWrapper @ Error.ts:11
eval @ Templater.ts:198
eval @ tslib.es6.js:76
__awaiter @ tslib.es6.js:72
append_template_to_active_file @ Templater.ts:184
onChooseItem @ FuzzySuggester.ts:50
t.onChooseSuggestion @ app.js:1
t.selectSuggestion @ app.js:1
e.useSelectedItem @ app.js:1
e.onSuggestionClick @ app.js:1
s @ app.js:1

@rapatel0
Copy link

@rapatel0 rapatel0 commented Sep 30, 2021

Seeing this as well.

I think it's related to the trigger on new file creation. I noticed that the "Empty File Template" box is missing from the options menu. It's likely that the template is never set and that this is causing the hook to break

@midnightmercenary
Copy link

@midnightmercenary midnightmercenary commented Sep 30, 2021

Broken for me as well. Where can I find the error log?

@SilentVoid13
Copy link
Owner

@SilentVoid13 SilentVoid13 commented Sep 30, 2021

Hey @Borber, when does this error happen? Can you try restarting obsidian and tell me if the bug still persist? If it does, can you show me the template that is causing that error?

@rapatel0 if that is indeed related to the old "empty file template" setting, just restart obsidian and it should be fixed.
You can now use "folder templates" as a replacement for the "empty file template" setting.

@SilentVoid13
Copy link
Owner

@SilentVoid13 SilentVoid13 commented Sep 30, 2021

Hey @midnightmercenary, you can find the error log by pressing Ctrl+Shift+I and going to console.

@pard68
Copy link

@pard68 pard68 commented Sep 30, 2021

Brand new to Obsidian, so a fresh install. Only folder I currently have is a /templates dir. I am using the example templater file from the docs. Getting this error as well. I've restarted Obsidian to no avail.

This is the 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 %>

<% tp.web.daily_quote() %>```

Only other plugins I'm using are Calendar and Daily Planner. I've disabled everything else.

@Borber
Copy link
Author

@Borber Borber commented Sep 30, 2021

Hey @midnightmercenary, you can find the error log by pressing Ctrl+Shift+I and going to console.

I can't insert any template without getting an error, even just plain text

@Borber
Copy link
Author

@Borber Borber commented Sep 30, 2021

Hey @midnightmercenary, you can find the error log by pressing Ctrl+Shift+I and going to console.

image

@SilentVoid13
Copy link
Owner

@SilentVoid13 SilentVoid13 commented Sep 30, 2021

@Borber can you show me your template file (the content)? Also try uninstalling and reinstalling Templater.

@pard68 Everything works fine on my end with this template (I'm on 1.9.6. but that shouldn't matter). I tried it on a fresh vault as you said and everything is good, I'm not sure what's the problem.

@Borber
Copy link
Author

@Borber Borber commented Sep 30, 2021

@Borber can you show me your template file (the content)? Also try uninstalling and reinstalling Templater.

@pard68 Everything works fine on my end with this template (I'm on 1.9.6. but that shouldn't matter). I tried it on a fresh vault as you said and everything is good, I'm not sure what's the problem.

Everything was fine after the reinstallation

@SilentVoid13
Copy link
Owner

@SilentVoid13 SilentVoid13 commented Sep 30, 2021

@Borber glad to hear that! Maybe the old settings that I removed in 1.9.x are making it fail, I'm not sure what was the problem.

@pard68 @midnightmercenary Try uninstall / reinstalling, that should fix it. Tell me if it fixes it.

@pard68
Copy link

@pard68 pard68 commented Sep 30, 2021

🎉 that worked! Weird I needed a reinstall on a fresh Obsidian... but who cares it worked 😂

@SilentVoid13
Copy link
Owner

@SilentVoid13 SilentVoid13 commented Sep 30, 2021

Nice, weird bug for sure.

@midnightmercenary
Copy link

@midnightmercenary midnightmercenary commented Sep 30, 2021

@Borber glad to hear that! Maybe the old settings that I removed in 1.9.x are making it fail, I'm not sure what was the problem.

@pard68 @midnightmercenary Try uninstall / reinstalling, that should fix it. Tell me if it fixes it.

I uninstalled the plugin, restarted Obsidian, re-installed plugin, and restarted Obsidian with no luck. While I'm no longer getting an error, the template is not rendering.

@geoffreysflaminglasersword

I'm having the same issue, here's my data.json as requested
data.zip

@SilentVoid13
Copy link
Owner

@SilentVoid13 SilentVoid13 commented Sep 30, 2021

@midnightmercenary dumb question but: did you enable the plugin?

@midnightmercenary
Copy link

@midnightmercenary midnightmercenary commented Sep 30, 2021

@midnightmercenary dumb question but: did you enable the plugin?

Yes I did,

I'm getting this error now:

loading markdown-table-editor plugin
quotes.rest/qod:1 Failed to load resource: net::ERR_CERT_AUTHORITY_INVALID
Log.ts:17 Templater Error: Template parsing error, aborting.
Failed to fetch
log_error @ Log.ts:17

@midnightmercenary
Copy link

@midnightmercenary midnightmercenary commented Sep 30, 2021

@midnightmercenary dumb question but: did you enable the plugin?

Yes I did,

I'm getting this error now:

loading markdown-table-editor plugin quotes.rest/qod:1 Failed to load resource: net::ERR_CERT_AUTHORITY_INVALID Log.ts:17 Templater Error: Template parsing error, aborting. Failed to fetch log_error @ Log.ts:17

Removing <% tp.web.daily_quote() %> from my Daily Notes Template fixed the issue. The template now renders. Is there a fix available for the Daily Quote issue?

@geoffreysflaminglasersword

Just fyi, I had 2 templates_folder variables in there somehow, but removing one didn't help

@geoffreysflaminglasersword
Copy link

@geoffreysflaminglasersword geoffreysflaminglasersword commented Sep 30, 2021

@midnightmercenary dumb question but: did you enable the plugin?

Yes I did,
I'm getting this error now:
loading markdown-table-editor plugin quotes.rest/qod:1 Failed to load resource: net::ERR_CERT_AUTHORITY_INVALID Log.ts:17 Templater Error: Template parsing error, aborting. Failed to fetch log_error @ Log.ts:17

Removing <% tp.web.daily_quote() %> from my Daily Notes Template fixed the issue. The template now renders. Is there a fix available for the Daily Quote issue?

For what it's worth, I am also using daily quotes, and opening a new daily note is where the issue first occurred

Although removing it doesn't fix the assigning to constant error

@pard68
Copy link

@pard68 pard68 commented Sep 30, 2021

@SilentVoid13 FYI, after restarting Obsidian the error has returned and requires me to then reinstall Templater again.

SilentVoid13 pushed a commit that referenced this issue Sep 30, 2021
@SilentVoid13
Copy link
Owner

@SilentVoid13 SilentVoid13 commented Sep 30, 2021

@pard68 @geoffreysflaminglasersword This should be fixed in 1.9.8. Sorry for the inconvenience, my tests should have caught that bug.

@Hernan-V
Copy link

@Hernan-V Hernan-V commented Jan 12, 2022

Will open a new one cause I find that from today the templates have error parsing the line "tp.web.daily_quote()".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants