Failed to publish resource: public: is a directory

I was using a very old version of hugo (0.123.x) to build my site. I planned to move to a new version and do a cleanup of my code.

So, I created a new project with hugo new project mysite, got the theme and hugo.yaml config file and the content directory.

Now, when I’m trying to render the page and see it locally, running hugo server -b 192.168.1.55 –bind ``http://192.168.1.55:1313`` -D I get this:

Watching for config changes in /home/user/site/hugo.yaml
Start building sites … 
hugo v0.158.0-f41be7959a44108641f1e081adf5c4be7fc1bb63 linux/amd64 BuildDate=2026-03-16T17:42:04Z VendorInfo=gohugoio

ERROR Failed to publish Resource: open /home/user/site/public: is a directory
Built in 1548 ms
ERROR error building site: logged 1 error(s)

There’s no public directory prior to running hugo server, and also I deleted the public directory that got rendered and retried and I still get the same error.

Help me troubleshoot this. Thanks!

Looks like I found the problem myself. I tried using hugo server –renderToMemory and I got an error about iit not being able to render a figure shortcode because the image file was not present on disk. I fixed that and now it all works, even with public already present.

What’s curious: I reverted the content file to the “problematic” stage and I tried to use --logLevel debug and I didn’t get any error, but hugo server failed again with the initial error.