Our local dev environment stopped working when we upgraded from Hugo 0.122.0 to 0.123.4. After upgrading, running hugo server
now resulted with:
Error: error copying static files: mkdir /var/www: permission denied
Task "Hugo Preview" exited with a non-zero exit status: 1.
That path /var/www
is the publishDir
for the remote server. It’s not typically accessible locally. Commenting out publishDir
in config.yml allowed us to work around the problem. I assumed this was just a regression that would be fixed soon, but then I found the list of known breaking changes in 0.123.0, specifically this one:
Adding --renderToMemory
to hugo server
has fixed us up.
Just wanted to publicly note this specific error we saw and how to fix it. It took a bit of digging for us to figure out, so I thought it might be helpful to others.