Open garraflavatra opened 4 years ago
Any solution to this yet? @garraflavatra
@DevTiqo You could put your images into the public folder and just insert the absolute URL to them, but the whole idea why to use require
instead a static URL for assets is asset footprinting, which is not applied when providing just a URL.
And looking at the number of open issues, I don't think this will be resolved soon 😕
I never had any problem/error with :src="require('~/assets/img/some-img,jpg')"
with all my nuxt + Vuetify projects.
Only difference I see to my Vuetify config: I use treeShake: true
. Maybe try that.
Update your dependencies and nuke your node_modules folder and do npm install
.
Thank you! I’ll try it tomorrow and close this issue if solved.
@garraflavatra how it goes with the issue?
Well, it's been 3 years since I encountered this issue, but honestly I haven't used this module ever since.
Does this problem still exist? (I don't think so, because the last commit is getting old too.)
Module version
1.11.0
Describe the bug The following code:
doesn't return an image, but it returns an error:
This also happens on this app bar:
I've also tried
src="~/assets/image.jpg
, which didn't work, too.Expected behavior I expected that the image renders correctly, but when I open the debug console, I see that the value of the image
src
tag not something like_/nuxt/img/g273g8h.jpg
is, but~/assets/image.jpg
. My browser tried thus to renderhttp://localhost:3000/~/assets/image.jpg
, which — of course — didn't work and throws a404 Not Found
error.Additional context My config file:
The Question Am I missing webpack config? Or have I something misconfigured? Or ...? How do I solve this problem?
What I've Tried I've tried to extend the webpack configuration like this:
Didn't work, because I think this is executed after the page is renderd (i.e. after the Vuetify tags are converted to HTML tags)
My Assumption I think that the above code is the right code, but we have to execute it before the Vuetify tags are converted to HTML tags.