title: Vue 3 + Vite image URL becomes undefined after build
body: <p>I encountered a bug where I dynamically generated a URL from props for image import in my Vue 3 component and it becomes undefined after build</p>
  <ul>
  <li>Script used to generate URL and the tag in Vue Component</li>
  </ul>
  <pre><code>const imagePath = computed(() =&gt; { return new URL(`../assets/${props.imgPath}.png`,
      import.meta.url).href
  
  &lt;img :src=&quot;imagePath&quot; /&gt;
  </code></pre>
  <ul>
  <li>Undefined URL after build
  <code>&lt;img class=&quot;img&quot; src=&quot;http://localhost:4173/undefined /&gt;</code></li>
  </ul>
  <p>Only two out of the many images are undefined after build which makes it very hard to pin down the problem</p>
  <p>I tried messing around with vite.config.ts, particularly assetInlineLimit under the build section but so far nothing works</p>