You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry, I couldn't work out whether the bug is in Dancer2 or Template Toolkit. Any idea how to test Template Toolkit independently?
Context
Template-Toolkit-3.101
Dancer2-1.1.0
Perl v5.36.0
Code to replicate the issue
#!/usr/bin/perl
use Dancer2;
set template => 'template_toolkit';
get '/foo' => sub {
return forward '/bar';
};
get '/bar' => sub {
return 'Hello, World!';
};
dance;
To demonstrate the bug
curl http://localhost:3000/foo
and this is what appears in the logs:
>> Dancer2 v1.1.0 server 19422 listening on http://0.0.0.0:3000
[main:19422] debug @2024-02-14 20:04:23> bless( ['file','404.tt: not found',undef], 'Template::Exception' ) in /usr/local/share/perl/5.36.0/Dancer2/Core/Error.pm l. 73
To dodge the bug
Just comment out this line:
set template => 'template_toolkit';
The text was updated successfully, but these errors were encountered:
I get this error when I try to curl http://localhost:3000/, but when I hit /foo, I get exactly what's expected.
That error is telling you that it's trying to use TT to render a 404 page, but there's no template available to satisfy that, and so TT throws an exception.
FYI, if you are running that test case directly from the command line, you won't have https available.
Sorry, I couldn't work out whether the bug is in Dancer2 or Template Toolkit. Any idea how to test Template Toolkit independently?
Context
Code to replicate the issue
To demonstrate the bug
and this is what appears in the logs:
To dodge the bug
Just comment out this line:
The text was updated successfully, but these errors were encountered: