If you're using Dust.js and finds something seems wrong with your templates, use the following techniques to debug your templates.

Debugging with @contextDump

The {@contextDump} helper outputs the current context portion of the JSON data model to the output stream. This can help with debugging if you suspect the context data is not as expected or you aren’t sure what the current context is.

You can set key="full" to print the full context, and to="console" to print to the console.

Remove this helper when you are done debugging.

Dust.js | Dust Core Helpers

Logging

Debugging can be turned on by setting dust.debugLevel to "DEBUG", "INFO", "WARN", or "ERROR" before you render the template.

Dust.js | Tips and Tricks