You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What did you do? Please include the actual source code causing the issue.
If an exception is thrown that is not handled, MarkBind logs the exception but does not return anything to standard output. For example, suppose we have the following MarkBind source:
<!-- the following will cause an exception in Nunjucks -->
{% set error = " %}
What did you expect to happen?
MarkBind should print the exception to standard output / error, or at least indicate to the user that they should investigate the log file for more information.
What actually happened? Please include the actual, raw output. markbind build aborts halfway with no feedback:
This behaviour is most likely because of a bug in Nunjucks. Errors were being swallowed on synchronous rendering. A fix was added by this PR in Nunjucks v3.1.7.
I installed Nunjucks 3.1.7 but markbind build still fails silently on adding a statement like {% set error = " %}.
I also tried configuring Nunjucks by adding nunjucks.configure({ throwOnUndefined: true }) in Site.js, Page.js and parser.js. This didn't throw an error too.
Apparently the errors were not being swallowed on asynchronous renders, so I tried adding callbacks in nunjucks.renderString() to handle errors (syntax) but I got the following:
(node:29797) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 logged listeners added. Use emitter.setMaxListeners() to increase limit
(node:29797) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added. Use emitter.setMaxListeners() to increase limit
Does anyone know how to fix this?
Or has another approach to handle errors thrown by nunjucks?
@amad-person not sure if its a Nunjucks problem: the fact that the exception is logged means that Nunjucks is throwing the error (since otherwise the error can't be logged). I suspect it might be the logger (winston@2.4.4) that's swallowing the error after logging it?
Tell us about your environment
What did you do? Please include the actual source code causing the issue.
If an exception is thrown that is not handled, MarkBind logs the exception but does not return anything to standard output. For example, suppose we have the following MarkBind source:
<!-- the following will cause an exception in Nunjucks --> {% set error = " %}
What did you expect to happen?
MarkBind should print the exception to standard output / error, or at least indicate to the user that they should investigate the log file for more information.
What actually happened? Please include the actual, raw output.
markbind build
aborts halfway with no feedback:However, the exception is logged:
The text was updated successfully, but these errors were encountered: