4👍
✅
To fix this issue, use new URL(url, import.meta.url) to resolve static assets both in prod and dev
See Vite documentation on Static Asset Handling : https://vitejs.dev/guide/assets.html#new-url-url-import-meta-url
const test = new URL('../assets/sprites/test.png', import.meta.url).href
Source:stackexchange.com