question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue with partials\helpers\image.html. [asset] image="image.png" breaks the site.

See original GitHub issue

Is this a BUG REPORT or FEATURE REQUEST?: bug

What happened: I have content/_index/services.md list fragment with front matter parameter section = blog. In content/blog/chocolate/ I have content fragment index.md and an image image.png.

Hugo throws an error when I set an image in fragment index.md, like so:

[asset]
  image = "image.png"

Here are the errors I get

Building sites … WARN 2019/11/05 19:05:16 .File.Dir on zero object. Wrap it in if or with: {{ with .File }}{{ .Dir }}{{ end }}
ERROR 2019/11/05 19:05:16 render of "home" failed: execute of template failed: template: _default\list.html:9:7: executing "_default\\list.html" at <partial "helpers/fragments-renderer.html" (dict "page_scratch" .Scratch)>: error calling partial: execute of template failed: template: partials/helpers/fragments-renderer.html:18:8: executing "partials/helpers/fragments-renderer.html" at <partial (print "fragments/" .Params.fragment ".html") $context>: error calling partial: "D:\Websites\mywebsite\themes\syna\layouts\partials\fragments\list.html:31:8": execute of template failed: template: partials/fragments/list.html:137:30: executing "partials/fragments/list.html" at <partial "helpers/image.html" (dict "root" $root "asset" .Params.asset)>: error calling partial: "D:\Websites\mywebsite\themes\syna\layouts\partials\helpers\image.html:31:8": execute of template failed: template: partials/helpers/image.html:31:8: executing "partials/helpers/image.html" at <fileExists (printf "content/%s" $location)>: error calling fileExists: CreateFile D:\Websites\mywebsite\content\%!s(<nil>)\image.png: The filename, directory name, or volume label syntax is incorrect.

ERROR 2019/11/05 19:05:16 render of "taxonomyTerm" failed: execute of template failed: template: _default\list.html:9:7: executing "_default\\list.html" at <partial "helpers/fragments-renderer.html" (dict "page_scratch" .Scratch)>: error calling partial: execute of 
template failed: template: partials/helpers/fragments-renderer.html:18:8: executing "partials/helpers/fragments-renderer.html" at <partial (print "fragments/" .Params.fragment ".html") $context>: error calling partial: "D:\Websites\mywebsite\themes\syna\layouts\partials\fragments\list.html:31:8": execute of template failed: template: partials/fragments/list.html:137:30: executing "partials/fragments/list.html" at <partial "helpers/image.html" (dict "root" $root "asset" .Params.asset)>: error calling partial: "D:\Websites\mywebsite\themes\syna\layouts\partials\helpers\image.html:31:8": execute of template failed: template: partials/helpers/image.html:31:8: executing "partials/helpers/image.html" at <fileExists (printf "content/%s" $location)>: error calling fileExists: CreateFile D:\Websites\mywebsite\content\%!s(<nil>)\image.png: The filename, directory name, or volume label syntax is incorrect.

ERROR 2019/11/05 19:05:16 render of "page" failed: execute of template failed: template: _default\single.html:9:7: executing "_default\\single.html" at <partial "helpers/fragments-renderer.html" (dict "page_scratch" .Scratch)>: error calling partial: execute of template failed: template: partials/helpers/fragments-renderer.html:18:8: executing "partials/helpers/fragments-renderer.html" at <partial (print "fragments/" .Params.fragment ".html") $context>: error calling partial: "D:\Websites\mywebsite\themes\syna\layouts\partials\fragments\list.html:31:8": execute of template failed: template: partials/fragments/list.html:137:30: executing "partials/fragments/list.html" at <partial "helpers/image.html" (dict "root" $root "asset" .Params.asset)>: error calling partial: 
"D:\Websites\mywebsite\themes\syna\layouts\partials\helpers\image.html:31:8": execute of template failed: template: partials/helpers/image.html:31:8: executing "partials/helpers/image.html" at <fileExists (printf "content/%s" $location)>: error calling fileExists: CreateFile D:\Websites\mywebsite\content\%!s(<nil>)\image.png: The filename, directory name, or volume label syntax is incorrect.

ERROR 2019/11/05 19:05:16 render of "taxonomyTerm" failed: execute of template failed: template: _default\list.html:9:7: executing "_default\\list.html" at <partial "helpers/fragments-renderer.html" (dict "page_scratch" .Scratch)>: error calling partial: execute of 
template failed: template: partials/helpers/fragments-renderer.html:18:8: executing "partials/helpers/fragments-renderer.html" at <partial (print "fragments/" .Params.fragment ".html") $context>: error calling partial: "D:\Websites\mywebsite\themes\syna\layouts\partials\fragments\list.html:31:8": execute of template failed: template: partials/fragments/list.html:137:30: executing "partials/fragments/list.html" at <partial "helpers/image.html" (dict "root" $root "asset" .Params.asset)>: error calling partial: "D:\Websites\mywebsite\themes\syna\layouts\partials\helpers\image.html:31:8": execute of template failed: template: partials/helpers/image.html:31:8: executing "partials/helpers/image.html" at <fileExists (printf "content/%s" $location)>: error calling fileExists: CreateFile D:\Websites\mywebsite\content\%!s(<nil>)\image.png: The filename, directory name, or volume label syntax is incorrect.
Total in 586 ms

Error: Error building site: failed to render pages: render of "page" failed: execute of template failed: template: _default\single.html:5:6: executing "_default\\single.html" at <partial "head.html" .>: error calling partial: "D:\Websites\mywebsite\themes\syna\layouts\partials\head.html:31:8": execute of template failed: template: partials/head.html:35:46: executing "partials/head.html" at <partial "helpers/image.html" (dict "root" $root "asset" .Params.asset "absolute" true)>: error calling partial: "D:\Websites\mywebsite\themes\syna\layouts\partials\helpers\image.html:31:8": execute of template failed: template: partials/helpers/image.html:31:8: executing "partials/helpers/image.html" at <fileExists (printf "content/%s" $location)>: error calling fileExists: CreateFile D:\Websites\mywebsite\content\%!s(<nil>)\image.png: The filename, directory name, or volume label syntax is incorrect.

What you expected to happen: I expected to see a thumbnail image for the blog post in the list fragment on my homepage. How to reproduce it (as minimally and precisely as possible):

You can reproduce this issue with my repo by uncommenting

[asset]
  image = "image.png"

in content/blog/chocolate/index.md Anything else we need to know?: I tried Hogo versions 0.58.3 and 0.59.1. Both throw the same error. I fully rely on themes build in partials. I do not have any custom partials. Environment:

  • Syna Theme version: v0.15.2
  • Hugo version:
Hugo Static Site Generator v0.59.1/extended windows/amd64 BuildDate: unknown
GOOS="windows"
GOARCH="amd64"
GOVERSION="go1.13.1"

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
mpourismaielcommented, Dec 4, 2019

I recommend using WSL and building on Linux or using WSL for production as well. Supporting Windows is kinda hard and time consuming since none of us have a Windows development environment. We will investigate the issue given the chance. We are always happy to receive Pull Requests to improve our Windows support. I’m sorry for the inconvenience.

0reactions
stp-ipcommented, Jan 22, 2020

To add a last comment for now. We mainly support linux based systems. We’ll leave this open to track and figure out what’s the culprit over the long term. Assuming it might be due to our fragment logic, that adds “/” separators that are linux only.

Read more comments on GitHub >

github_iconTop Results From Across the Web

7 Reasons Why Images Are Not Loading on Your Website
Website images fail to load for one of these seven common reasons. ... but your HTML is looking for a .png, there will...
Read more >
Angular 6 Failing To Load Images From Assets - Stack Overflow
png is in my assets folder which is located at src/assets/image.png. Update: So we did a test. We copied all the node modules...
Read more >
How to Fix a Broken Image on a Website [Guide]
When image html does not show up, or a picture won't display because it has not loaded, that's a broken image. Learn how...
Read more >
Error when loading author image with Toha theme - HUGO
I'm getting the following error when trying to load a png in my site. ... partial: “/themes/toha/layouts/partials/sections/home.html:31:44”: execute of ...
Read more >
background-image - CSS: Cascading Style Sheets | MDN
Layering background images. Note that the star image is partially transparent and is layered over the cat image. HTML. < ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found