Taylor Austin
Taylor Austin

Reputation: 5987

absolute path not working in gatsby with images?

Here is the image:

<img src="src/img/image.svg" alt="" />

The folder structure is like so:

src
 -img
 -components
 ...etc

Yet the image shows nothing and I get a 404 error in the console?

Upvotes: 2

Views: 4190

Answers (1)

Tholle
Tholle

Reputation: 112777

Gatsby looks for static assets in the static folder at the root of your project, so make sure your image is located at static/src/img/image.svg if you want your example image to work, and you don't want to use the Webpack module system.

Upvotes: 5

Related Questions