Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to include - template could not be found #196

Open
richp10 opened this issue Sep 27, 2021 · 4 comments
Open

Unable to include - template could not be found #196

richp10 opened this issue Sep 27, 2021 · 4 comments

Comments

@richp10
Copy link

richp10 commented Sep 27, 2021

I'm sure this is a stupidly simple problem - but I'm staring at it and just can't see what is going on!

Views are in a folder two levels below the executable (in www/views) and jet is configured like this:

engine = jet.New("www/views", ".jet")

I have a template www/views/register.jet that works just fine, with the page displayed. I then add another template to the folder 'header.jet' and add the following to the top of register.jet

{{ include "./header.jet" }}

But if I reload the page, I get an error:

Jet Runtime Error ("/register":1): template /header.jet could not be found

I have tried various things such as addint the path, such as www/views/header.jet but cannot get it to work.

Thanks for any thoughts..

@martinjanda
Copy link

Hi @richp10,
I had the same problem. You must enter a template name without .jet, for example {{ include "header" }}.

I know, it's not entirely intuitive, but it works.

@BRUHItsABunny
Copy link

Hi @richp10, I had the same problem. You must enter a template name without .jet, for example {{ include "header" }}.

I know, it's not entirely intuitive, but it works.

This worked for me

@shellohunter
Copy link

Hi @richp10, I had the same problem. You must enter a template name without .jet, for example {{ include "header" }}.

I know, it's not entirely intuitive, but it works.

yes, after an hour's debugging, I cannot believe this is the root cause!
Why that jet has such unreasonable and confusing impl?
This is ridiculous.

@marcelloh
Copy link

Perhaps, change cloudykit to have a better error message ?
Like "header.jet.jet" not found or something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants