Hi,
One thing to note is that only the last engines block will have effect in your config (although that is clearly not the source of this problem).
I was able to reproduce your issue with the test app generated by dancer2 gen -a by adding a line after the template ... statement. My failing file:
The debug log statement was printed to the log but no output was shown in the browser. Removing/commenting the line fixed the problem. I believe this is because the output of the last line in the handler is what is returned to the browser. (From the doc: "Note that template simply returns the content, so when you use it in a route handler, if execution of the route handler should stop at that point, make sure you use return to ensure your route handler returns the content.") Adding a line with output shows this:package My::TestApp; use Dancer2; our $VERSION = '0.1'; get '/' => sub { template 'index' => { 'title' => 'My::TestApp' }; debug 'after templating'; }; true;
The browser shows 'foo' with this code.package My::TestApp; use Dancer2; our $VERSION = '0.1'; get '/' => sub { template 'index' => { 'title' => 'My::TestApp' }; debug 'after templating'; 'foo'; }; true;
Do you have any other code in the route handler in sandbox.pm after the template statement?
Hope this helps!
Update: added quote from the doc
In reply to Re: Why won't my Dancer2 app render any output???
by 1nickt
in thread Why won't my Dancer2 app render any output???
by traveler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |