quickadd: [BUG] More info to debug "Could not create file with template. Maybe '${templatePath}' is an invalid template path? received for valid template path"

Describe the bug It would be helpful to have more information in the error message:

Could not create file with template. Maybe '${templatePath}' is an invalid template path?

What I’m doing

Following your video: https://youtu.be/gYK3VDQsZJo?t=788

Background

I’m getting this message for a file that definitely exists:

image

My file template definitely exists, and Templater is definitely running - so I’m struggling to know what to do next.

I see in the code that there is an exception object:

        catch (e) {
            log.logError(`Could not create file with template. Maybe '${templatePath}' is an invalid template path?`);
            return null;
        }

Is there any possibility that the text of the exception could be included in the error message please?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 22 (4 by maintainers)

Commits related to this issue

Most upvoted comments

Hi, sorry for commenting on a closed ticket, but this particular error-message also appears when using non-legal characters as a title/filename, such as a questionmark (?) on Windows-machines. Would you rather see a separate ticket for this?

It’s all right. If an illegal character is given, then it can’t create the file - so it’s working as intended. Or am I missing something?

In a sense, yes. But the problem is that the error-message is misleading as it points to an error with the template instead of the filename of the new note.

Hey! I’ve found what seems to be a fix (after lots of testing). Can you confirm? 😃

🎉🎉🎉🎉🎉🎉

Hooray - thank you very much indeed!

quickadd “0.4.8” and templater “1.9.2” work fine for creating new files.

I’ll pop a message in the Obsidian Discord templater thread, where someone else was asking about what may be the same problem.

Hey! I’ve found what seems to be a fix (after lots of testing). Can you confirm? 😃

Thank you for the details! I’ll look into it. I believe that, because of the Templater update, the connection is now ‘bugged’.

Thank you!

Seems I was a little unlucky picking today to start learning about quickadd and templater - but it’s fine, there’s plenty of other Obsidian stuff to be discovering!

Hi, sorry for commenting on a closed ticket, but this particular error-message also appears when using non-legal characters as a title/filename, such as a questionmark (?) on Windows-machines.

Would you rather see a separate ticket for this?