FindFirstFile error when changing .css file using Visual Studio #5491

Github issue: https://github.com/gohugoio/hugo/issues/5491#issuecomment-443549757
IDE: Visual Studio Community 2017
Hugo version: 0.52

I get these error when I change the .css file

FindFirstFile D:\Projects\HugoTutorial\coconut\themes\hugo-theme-coconut\static\css\main.css~RF2df0652.TMP: The system cannot find the file specified.
FindFirstFile D:\Projects\HugoTutorial\coconut\themes\hugo-theme-coconut\static\css\main.css~RF2df0652.TMP: The system cannot find the file specified.
Hugo Static Site Generator v0.52 windows/amd64 BuildDate: 2018-11-28T14:07:10Z

Reload Page

To get rid this error, I need to disconnect localhost and connect hugo server again.
Now I temporarily switch back to Hugo version of 0.48 which it has no such issue.

@zwbetz

Thanks for creating this – Can you share your site code so that I can attempt to reproduce your issue?

Move temp file directory out of your project directory, best to a directory on the same disk.
Hope this helps

EDIT

I could not find (in short time) options for VS.

Some editors write a tmp file, delete the original and rename the tmp.

Setting the TEMP or TMP environment could help. This is defaulted to %LOCALAPPDATA%\temp.

1 Like

@ju52 this is how many editors do “atomic saves” – i.e. save to a temp file and rename. So that is pretty normal. That said, I think this is Visual Studio issue and not Hugo related. I think …

2nd for the config file

ignoreFiles = [ “\.tmp$” ]

say Huugo to ignore tmp files

1 Like