Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vue-cli-plugin-vuetify breaks relative asset path transforms #345

Open
mediafreakch opened this issue Jan 16, 2023 · 1 comment
Open

vue-cli-plugin-vuetify breaks relative asset path transforms #345

mediafreakch opened this issue Jan 16, 2023 · 1 comment

Comments

@mediafreakch
Copy link

mediafreakch commented Jan 16, 2023

Problem description

vue-loader provides a mechanism to transform a relative asset path inside a template to a javascript module:

// source
<template>
  <img src="../image.png" />
</template>

// result after transform
createElement('img', { attrs: { src: require('../image.png') // this is now a module request } })

This works on a new vue-cli project (without vuetify-plugin). But it breaks as soon as the vuetify plugin is added.
As a result, the relative path isn't transformed and this results in a 404 when the app is rendered.

Example

The behaviour can be reproduced here: https://stackblitz.com/edit/github-ahnvys-fgocjn?file=src/components/HelloWorld.vue

Workaround

The workaround is to use :src="require('./{assetPath}')" . However I think this is a bug that should be fixed or documented. I spent hours debugging after upgrading from vuetify 2 to v3.

@KaelWD KaelWD transferred this issue from vuetifyjs/vuetify-loader Jan 28, 2023
@KaelWD KaelWD changed the title webpack-plugin-vuetify breaks relative asset path transforms vue-cli-plugin-vuetify breaks relative asset path transforms Jan 28, 2023
@sarahLardeau
Copy link

I got the same issue ! Could it be fixed ? The workaround works but it remains a workaround. It is not great to need to change all our asset paths during the migration... 😕

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants