question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:22 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
flatrickcommented, Nov 29, 2021

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.

2reactions
claremacraecommented, Sep 28, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

circleci config.yml: 'Invalid template path template.yml'
It's error because the job could not find the template.yml path. Just set the working_directory and specify the file name, which should work....
Read more >
QuickAdd plugin not recognizing template path - Help
QuickAdd(ERROR): Could not create file with template. Maybe '/000-meta/templates/book-template.md' is an invalid template path?
Read more >
Configuration (FreeMarker 2.3.31 API)
Sets the charset used for decoding byte sequences to character sequences when reading template files in a locale for which no explicit encoding...
Read more >
Docmosis Release Notes - Docmosis Resources
Static images anchored to last line of sub-template could be lost. - Merge could fail with “unable to navigate to bookmark” error when...
Read more >
Documaker Connector Developer Guide 12.4
For more information about the configuration and execution of Documaker Connector, ... destination.ftp.template.path in the Configuration to list out the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found