Vite React app fails to build due to image import

I have a Vite + React app, and when I tried to deploy it to netlify using github, build command fails saying that couldn’t resolve “./assets/img.png”
I placed the assets folder in @root/src and imported it
import src from “./assets/img.png”
It totally works find on my local, and build also works without error
But build on netlify returns error
Please help me with this

Hi @Clox,

Thanks for reaching out and welcome the Netlify’s Support Forums.

Could you provide us with the site name or a link to the site? This will help us find the site to review the deploy logs. Thanks!