1 of 6 Images does not show up on Netlify page. Local works

Hey guys,

I’ve tryed to test a website on Netlify. Everything works like a charm.
But i got one problem. One of my 6 used images is not shown on the website.

The 5 images shown are used like this:

The one not working is used as a background image:

.bgImg {
background-image: url(‘/src/assets/anlagebackground.webp’);
opacity: 1;
Here is the site (still work in progrss) :

I tryed different images, or setting style"background-image: url(‘/src/assets/anlagebackground.webp’)" direct to the div.
Nothing worked.

I’ve noticed something in the deploy log, there are only 5 images listed:
7:25:06 PM: dist/assets/logo-a9707999.webp 10.88 kB
7:25:06 PM: dist/assets/loesung-39c7247c.webp 22.85 kB
7:25:06 PM: dist/assets/zuverlaessigkeit-debb18d0.webp 46.99 kB
7:25:06 PM: Post processing - HTML
7:25:06 PM: dist/assets/avatar-e15aa6fd.webp 91.94 kB
7:25:06 PM: dist/assets/perfektion-576f83e0.webp 142.76 kB

my netlify.toml:
NPM_FLAGS = “–version”

publish = “dist”
command = “npx pnpm i --store=node_modules/.pnpm-store && npx pnpm run build”

from = “/*”
to = “/index.html”
status = 200

Thanks for your time!

@Padda This is almost certainly just your project and not anything to do with Netlify.

You might want to take another look at the Static Assets Documentation for Vite and make sure you have the asset referenced in a way where it will be taken into consideration and put into your /dist folder.

One way you can confirm that it’s not Netlify related will be to run an npm run build locally, then go into your /dist folder and run npx serve, then open the local web server that it creates, you should see precisely the same thing you’re seeing on Netlify.

1 Like

You are right, thanks looking into it :smiley: