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

Error generationg webp #244

Open
fainemesquita opened this issue Sep 24, 2020 · 3 comments
Open

Error generationg webp #244

fainemesquita opened this issue Sep 24, 2020 · 3 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@fainemesquita
Copy link

Error when trying to generate webp images.

Whenever I use "?webp" as in the example below, I get the following error:
"Failed to compile with 1 errors
This dependency was not found:

  • ~/assets/images/home-header-mobile.jpg?webp in ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./node_modules/string-replace-loader??ref--11!./pages/index.vue?vue&type=template&id=2a183b29&scoped=true&

To install it, you can run: npm install --save ~/assets/images/home-header-mobile.jpg?webp"

        <figure class="picture">
            <picture>


              <source :srcSet="require('~/assets/images/home-header-mobile.jpg?webp')" type="image/webp" />
              <source :srcSet="require('~/assets/images/home-header-mobile.jpg')" type="image/jpeg" />
              <img :src="require('~/assets/images/home-header-mobile.jpg')" />
            </picture>
          </figure>

Removing the "?webp" particle allows my code to run but obviously I don't get a webp. Lazy loading is working fine though.

@RauppRafael
Copy link

Have you installed webp-loader as a dependency?

@fainemesquita
Copy link
Author

Yes, I have it installed.

In the meantime, had updated all my packages and it now works for jpg.
However, nothing is displayed neither I have an error thrown when I try to use the same approach for svg.
Changed the type to type="image/svg+xml" and type="image/svg" with no success.

@juliomrqz
Copy link
Owner

@fainemesquita Can you provide a live example? Maybe using CodeSandbox. Thanks.

@juliomrqz juliomrqz added bug Something isn't working help wanted Extra attention is needed labels Jan 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants