Search code examples
reactjsgatsby

Incorrect UNC path when doing gastby serve


I am getting below error when doing gatsby serve as my office is using proxy and it will not paths like this one given below.

Error: UNKNOWN: unknown error, copyfile 'C:\gatsby\static.gitkeep' -> 'C:\gatsby\public.gitkeep'

When i check the app which is stopping the file copy, in it's logger i see URL it starts with \\?

\\?C:\\FILE URL

Can anyone please guide what am i doing wrong.


Solution

  • You have a hidden file inside the /static folder named .gitkeep. The static folder is transpiled into the public one using its internal structure when you build and serve the project and it's failing because it's not a valid type file.

    To solve the issue just remove the .gitkeep file.