-
Notifications
You must be signed in to change notification settings - Fork 641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Errors seem to be swallowed. #1127
Comments
Can you provide the example illustrating the issue? Thanks! |
Hi @devoidfury. Here's is an example of missing import. No errors are thrown, the result
If I change the render to async, I do get an error in the callback:
I hope this is clear, many thanks |
I am seeing this with |
This also happens for |
Looks like this could be related to #678 |
Sorry to revive an old post, but I started using Nunjucks some days ago and the problem is still there. I'm using |
@leosdad two questions: are you passing a callback into |
If the answer to the first question is no, and you're using the latest version, would it be possible to paste a minimal test case showing the problem? The example provided in the comment above is fixed in the latest version. So if you're experiencing an issue with exceptions being swallowed, it is likely a different problem and ought to be its own issue. |
Hi, @fdintino! Yes, I'm using the latest version, and I'm using no callback with |
Thank you. And just to make sure I don't miss it, could you instead post it in a new issue? |
Sure, I'll do that. |
I've opened issue #1272 with the test case. |
I'm new to Nunjucks so please forgive me but I'm finding it very hard to debug when things start going wrong as errors don't seem to propagate up.
Whether it's a syntax error in the template, or a missing template, no errors are raised and and null is returned from the
template.render(context)
method.My render pipeline is sync, the only way I've been able to get it to report the error though is to provide an error-first callback to the
render
method, get the error, then remember to remove the callback after. This is quite frustrating.I've also tried setting the
throwOnUndefined
option totrue
but that doesn't seem to make a difference.Can anyone shed a light on this? I can provide some example code if needed.
While this is proving to be painful from a dev point of view, my bigger concern is that errors are swallowed in production.
Many thanks
Dave
The text was updated successfully, but these errors were encountered: