Gatsby: Error: ENOTDIR: not a directory, unlink '/gatsbysite/public/svg/grid-bg.svg'

Created on 11 Jan 2018  Â·  7Comments  Â·  Source: gatsbyjs/gatsby

Description

Okay this is a weird one for me...if I place an SVG file...anywhere, including static, Gatsby throws the following error (Note: usernames and directories are omitted for anonymity):

error ENOTDIR: not a directory, unlink '/gatsbysite/public/svg/grid-bg.svg'


  Error: ENOTDIR: not a directory, unlink '/gatsbysite/public/svg/grid-bg.svg'

error UNHANDLED REJECTION


  Error: ENOTDIR: not a directory, unlink '/gatsbysite/public/svg/grid-bg.svg'

If it's any help, I am using gatsby-starter for this project. Am I missing something here? I'm not completely understanding what's happening here...

Expected behavior

As far as I can tell, this should not be a problem and SVGs should be fine. However for some reason Gatsby is throwing a hissy fit of sorts.

Most helpful comment

I experienced this as well, while I add a file and delete the file in static folder. Then I found that the file link still exists in public folder. After deleting it in public folder, the error is gone.

All 7 comments

That's unexpected...

What are the steps to reproduce this?

The only thing I've done is placing an SVG under static. That's it. 😆 I've tried this with other SVG files, and if I remember correctly, I tried placing some under src to use in components but same error.

Could be a file permission error perhaps. Do other files fail as well?

No, I think it's okay with images like JPGs. I'll try with PNGs and GIFs as well. JPGs are placed under static/images and get output to public/images — I'm hoping that's the correct output as it also outputs an empty static folder!

GIFs and JPGs are being output fine.

I experienced this as well, while I add a file and delete the file in static folder. Then I found that the file link still exists in public folder. After deleting it in public folder, the error is gone.

Due to the high volume of issues, we're closing out older ones without recent activity. Please open a new issue if you need help!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dustinhorton picture dustinhorton  Â·  3Comments

dustinhorton picture dustinhorton  Â·  3Comments

ferMartz picture ferMartz  Â·  3Comments

signalwerk picture signalwerk  Â·  3Comments

benstr picture benstr  Â·  3Comments