Martin Weissenboeck
Martin Weissenboeck

Reputation: 723

SvelteKit: no image with npm run build

This is a very simple SvelteKit program:

<img src="static/bird.jpg" alt="a bird"/>

When I run it with npm run dev, the image is displayed. But when I use npm run build and npm run preview, only the alt text is displayed.

What can be the cause? It looks like this.

I use SvelteKit v1.0.0-next.107

Upvotes: 3

Views: 1943

Answers (1)

Martin Weissenboeck
Martin Weissenboeck

Reputation: 723

I have found the solution:

<img src="/bird.jpg" alt="a bird"/>

Path without static.

Upvotes: 9

Related Questions