SvelteKit: no image with npm run build

Viewed 1046

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

1 Answers

I have found the solution:

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

Path without static.

Related