Open paul-norman opened 3 months ago
@paul-norman thanks for catching that! I just pushed a quick clarification to the docs, but I'd be open to a PR with more details / a better explanation!
I've just started actually porting some EJS code to ETA today, so I'm a total beginner with the system. However, after I've used it for a little while I will take another look at the docs and see what doesn't make sense to me then...
Describe the Bug:
This is a documentaion bug! When using a programatically defined template the docs state: "The third argument to loadTemplate is a boolean describing whether the template is async or not. By default, Eta will assume that the template is synchronous."
Using this advice, calling a programatically defined template using
renderAsync
will result in anEtaNameResolution
error. (includeAsync
has the same issue)To Reproduce:
Expected Behaviour:
The template should be found and rendered.
Package & Environment Details
Additional Context:
Removal of the Async call will succeed:
As will passing the object that the code actually expects:
Just a slighly more complete example to assist future travellers who are loading their templates from a database (or wherever!) while the documentation / examples for Eta are still rather sparse: