sukria/Dancer — Issue #719: Dancer can't create a new Template
Author: neniu
Created: 2011-12-29 21:42:56+00:00
State: open

I have an app that I am trying to deploy under Apache2 and Plack.

I get a 500 Internal Server error when I try to load a page and

Error while loading /www/domains/thegsa.org/dancer/bin/app.pl: Can't locate object method "new" via package "Template" (perhaps you forgot to load "Template"?) at /usr/lib64/perl5/site_perl/5.12.2/Dancer/Template/TemplateToolkit.pm line 45.\nBEGIN failed--compilation aborted at /www/domains/thegsa.org/dancer/bin/app.pl line 2.\n

in the log.

The offending line is in the init() method. Part of that is
```
croak "Template is needed by Dancer::Template::TemplateToolkit"
unless Dancer::ModuleLoader->load('Template');
....
$_engine = Template->new(%$tt_config);
```

Despite the load(), which didn't cause a croak so probably worked, the new() fails.

I added ```use Template``` to the start of the file but this still does not work.