Hi, today I had weird issue, I have registered templates, then seen 1 error in console about one of the templates, but application didn't fail, it worked but didn't load more templates.
1.html
2.html
3.html // Lets say this template is broken, 4 wont be loaded, but the app will behave like it's ok
4.html
How to reproduce?
htmlEngine := html.NewFileSystem(templates.GetFiles(), ".html")
app := fiber.New(fiber.Config{
Views: htmlEngine,
})
for _, v := range htmlEngine.Templates.Templates() {
println(v.Name())
}
now create package names templates and put some html files, then in one of these files put {{ ItDoesNotExists }}
then create .go file with code below:
package templates
//go:embed *.html
var content embed.FS
func GetFiles() http.FileSystem {
return http.FS(content)
}
Hi, today I had weird issue, I have registered templates, then seen 1 error in console about one of the templates, but application didn't fail, it worked but didn't load more templates.
How to reproduce?
now create package names
templatesand put some html files, then in one of these files put{{ ItDoesNotExists }}then create .go file with code below: