3

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 Answer 1

9

I have found the solution:

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

Path without static.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.