Fixing SVG Not Found with VuetifyJS 3.x and ViteJS

Di.rk
Dec 11, 2022

--

Using the new VuetifyJS 3.x with ViteJS I got a problem with the “Get Started” path in the description. The demo application works in dev mode but lacks the logo in production. The solution was not so hard to find.

Simply use the possibility to import SVGs into the page

<script setup>
import logo from '@/assets/logo.svg'
</script>

and afterwards use it in the HTML template like this

<v-img
contain
height="300"
:src="logo"
/>

This works in both environments development and production.

--

--

Di.rk
Di.rk

Written by Di.rk

Developer since the 80'th …

No responses yet