How to use include when async option is passed?
See original GitHub issueI am storing email templates in files and I have header and footer file.
I am trying to use async for renderFile
with this template:
<%- include('header'); -%>
<h1>
Title
</h1>
<p>
My page
</p>
<%- include('footer'); -%>
const options = { async : true };
the includes are replaced with [object object]
.
how can i use include and async together?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:7 (3 by maintainers)
Top Results From Across the Web
async function - JavaScript - MDN Web Docs - Mozilla
Async functions can contain zero or more await expressions. Await expressions make promise-returning functions behave as though they're ...
Read more >javascript - Async - passing variables and preserving context
All I want is to pass some of my current state into this task executor. In coffeescript my code looked like this: _metadata...
Read more >Task asynchronous programming model - Microsoft Learn
Start with the method signature. It includes the async modifier. The return type is Task<int> (See "Return Types" section for more options).
Read more >std::async - cppreference.com
The function template async runs the function f asynchronously (potentially in a separate thread which might be a part of a thread pool)...
Read more >Understanding the Event Loop, Callbacks, Promises, and ...
An async function allows you to handle asynchronous code in a manner that appears synchronous. async functions still use promises under the hood ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This works for my setup:
Ultimately we want to make all the I/O async, so opting into async rendering with the top-level
async
flag should be enough to make the entire tree async. You shouldn’t have to opt in to includes being async on top of that.