-
Notifications
You must be signed in to change notification settings - Fork 643
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Exceptions being swallowed after import errors in included templates #1272
Exceptions being swallowed after import errors in included templates #1272
Comments
(bump) Any news? TIA |
Hi again, Any prospects on this problem? |
This is quite the issue would be interested in some guidance. |
Thanks for your attention. A minimal test case would be as follows.
const nunjucks = require('nunjucks');
console.log(nunjucks.renderString('{% include "included.njk" %}', { str: 'okay' }));
String is {{ str }}
{% import 'unknown.njk' as dummy %}
String is {{ str }}
I hope it's clearer now! |
Oh my bad! I'm experiencing the same error! Sorry for that confusion, was hoping someone could help me (us) figure that out. |
I'm looking into this |
Appreciate it! Will test. |
As stated in topic #1127, there are still problems with exceptions not being thrown in certain cases. I found out that if some problem happens with import errors inside included templates, Nunjucks will fail to generate the required exceptions. For example, create a template included.njk:
and the following script:
Nunjucks silently outputs a
null
string. Some notes:import
is removed from the njk file.I hope this is clear. Thanks in advance!
The text was updated successfully, but these errors were encountered: