Filename too long error when compiling site

As I mention in my github post here (, I get the following error message when I compile my site by simply running hugo:

Building sites … ERROR 2018/11/04 16:20:42 error: failed to transform resource: open /home/zdorovo/Documents/web/hugosite/themes/academic/exampleSite/public/js/mathjax-config.500a6cbb2c0f345fcecc21b3116d[redacted].js: file name too long Total in 2473 ms Error: Error building site: logged 1 error(s)

A couple of things stand out about this as weird to me:

  • I don’t get any errors when I run the command hugo server
  • Moving the directory with my website doesn’t change things. Indeed, I moved it to get the (absolute) filename down to ~180 characters. I’m using ubuntu on an ext4 partition, so as far as I can tell, my max filename length should be 255 characters. I’m still getting the error message though

I’m using the academic theme. Any help would be greatly appreciated.

Here’s what I get when I type hugo env:
Hugo Static Site Generator v0.50 linux/amd64 BuildDate: 2018-10-29T12:39:37Z

Do you get the same error when running this?

hugo server --renderToDisk

Yes, I still do.

Okay good.

Can you share your site code, or create a sample repo, so that we can attempt to reproduce this locally?

Made a sample project using the exampleSite from the hugo academic theme. That same JS file giving you trouble:


Is 205 characters for me. I’m on macOS and the sample site builds no problem.

As mentioned in the GitHub issue you linked, this is likely an issue with the OS/filesystem/configuration you are using.

@zdorovo Academic creator here. If you update to the latest master version of Academic, it should now work for you. Although the underlying issue is related to the OS/filesystem, I have reduced the length of the MathJax JS filename by removing the long Sha512 asset fingerprinting. For more details, refer to the commit at

1 Like

Thanks so much! I didn’t know where to begin fixing this filesystem issue…

Search SHA512 and replace it with “SHA256” or remove the fingerprint