Home

Issue: 2099

path to assets folder is not resolved when using <object>/<embed>

[issue link]

If I reference a SVG assets, e.g. ~/assets/svg/list.svg using an <object> or <embed>, vue-loader does not resolve the path. If use an <img> tag, everything is fine.

Output:
<object src="~/assets/svg/list.svg"></object>

<img src="/_nuxt/img/list.e48b737.svg">

Steps to reproduce:

  1. Create a page (whatever.vue) in the pages folder
  2. Create a <template> in whatever.vue
  3. Download the attached ZIP file and extract it into the assets folder. svg.zip
  4. Inside the template, put <ol><li><object src="~/assets/svg/list.svg"></object></li><li><img src="~/assets/svg/list.svg"></li></ol>
  5. Observe that the first item does not render whereas the second does.
This question is available on Nuxt.js community (#c1862)