question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Vuetify] Image load failed

See original GitHub issue

Hi, I’m using a Vue Cli 3 template with Vuetify, and Vuetify loader, but when trying to use a progressive image i get the following error:

screenshot 2018-10-17 at 11 36 55

<VImg src="@/assets/img/home/mac-left.jpg" /> gives this error. I know the location is correct, because if i change to <img src="@/assets/img/home/mac-left.jpg" /> the image works properly, so it has something to do with the loader.

Here’s the vue.config.js, which should resolve to the correct webpack config.

const VuetifyLoaderPlugin = require('vuetify-loader/lib/plugin');
const { VuetifyProgressiveModule } = require('vuetify-loader');

module.exports = {
  chainWebpack:  config => {
    config.resolve.alias
      .set('vuetify/lib', 'vuetify/es5/components');
    config.plugin('vuetify-loader')
      .use(VuetifyLoaderPlugin);
    config.module
      .rule('vue')
      .use('vue-loader')
      .loader('vue-loader')
      .tap(options => {
        options.compilerOptions.modules = [VuetifyProgressiveModule];
        return options;
      });
    config.module
      .rule('images')
         .oneOf('progressiveImages')
              .test(/\.(png|jpe?g|gif)$/)
              .resourceQuery(/vuetify-preload/)
              .use('vuetify-loader/progressive-loader')
                  .loader('url-loader')
                  .options({ limit: 8000 })
                  .end()
              .end()
          .oneOf('progressiveImagesOther')
              .use('url-loader')
                  .loader('url-loader')
                  .options({ limit: 8000 })
                  .end()
              .end();
  },
};

I’ve installed both ImageMagick and GraphicsMagick, both of them return same issue. Loader seems to be returning a base64 string, but it must be parsed incorrectly, since, strings that are returned can’t be parsed to the image.

Is there something I’m missing? Could it be caused by Vue Cli 3 maybe?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

99reactions
as4101741commented, Jan 9, 2019

try to use <v-img :src="require(‘@/assets/img/home/mac-left.jpg’) ></v-img>

0reactions
nadilascommented, Jan 9, 2019

@as4101741 great 😉 that does it

Read more comments on GitHub >

github_iconTop Results From Across the Web

vue.js - Vuetify- image Load failed - Stack Overflow
As you can see here and here, the message is generated as a result of onerror event raised by browser itself so this...
Read more >
Vuetify Image load failed - Get Help - Vue Forum
I have a problem Loading some Image in Vuejs using v-img inside v-carousel-item. I get this error. Is there any error in my...
Read more >
[Solved]-Vuetify Image load failed-Vue.js - appsloveworld.com
Coding example for the question Vuetify Image load failed-Vue.js. ... To see what they get compiled into, simply console.log(this.images) in mounted() .
Read more >
Image component — Vuetify
Usage. v-img component is used to display a responsive image with lazy-load and placeholder.
Read more >
vue dynamic image src
Failed to load latest commit information. Type. Name. Progressive images. vuetify-loader can automatically generate low-res placeholders for the v-img ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found