I created a ‘Templaters’ folder and created a file called Notice where I the following template:
<%* tp.user.notice(tp) %>
I also created a Scripts folder and created a notice.js file where I put the following:
async function notice(tp) {
const text = await tp.system.prompt(“What’s Good?”)
new Notice(text, 5000)
}
module.exports = notice
I then tried to insert the Notice template into a new file but got the following error: Template parsing error, aborting. tp.user.notice is not a function.
Hope to get some help on this!
p.s. I’ve ensured that my settings are correct i.e. specifying the scripts folder and templaters folder.
From what I can see, it seems that the error may be with your notice.js file. For example, line 3 should have notice in lowercase rather than uppercase.
Try this.
async function notice(tp) {
const text = await tp.system.prompt("What's Good?")
new notice(text, 5000)
}
module.exports = notice
Unfortunately, I am still getting the same error. Is it possible for you to show me screeenshots of how you are doing it so that I can attempt to replicate 1 for 1?